FreeBSD Bugzilla – Attachment 115399 Details for
Bug 157168
[bsd.port.mk] New hook: CONF_FILES automatically handles configuration files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch.txt
patch.txt (text/plain; charset=US-ASCII), 4.87 KB, created by
Chris Rees
on 2011-06-25 11:56:51 UTC
(
hide
)
Description:
patch.txt
Filename:
MIME Type:
Creator:
Chris Rees
Created:
2011-06-25 11:56:51 UTC
Size:
4.87 KB
patch
obsolete
>Index: bsd.port.mk >=================================================================== >RCS file: /exports/cvsroot-freebsd/ports/Mk/bsd.port.mk,v >retrieving revision 1.686 >diff -u -r1.686 bsd.port.mk >--- bsd.port.mk 9 Jun 2011 08:22:45 -0000 1.686 >+++ bsd.port.mk 25 Jun 2011 10:08:34 -0000 >@@ -631,6 +631,8 @@ > # INSTALL_DATA - A command to install sharable data. > # INSTALL_MAN - A command to install manpages. May or not compress, > # depending on the value of MANCOMPRESSED (see below). >+# INSTALL_CONF - A command to install configuration files. Not normally called >+# by ports directly, use CONF_FILES (see below). > # > # Boolean to control whether manpages are installed. > # >@@ -687,6 +689,18 @@ > # Default: "share/info" if ${PREFIX} is equal to /usr > # and "info" otherwise. > # >+# Set the following to specify all conf files your port installs. >+# >+# CONF_FILES - A list of configuration files that have been installed as >+# sample files (with the extension .pkgconf), relative to >+# PREFIX. Shell glob patterns can be used, directories include >+# the entire subtree of contained files with these >+# extensions and directories. >+# Files included will be copied over if not already existing, >+# and will be removed on deinstall if the same as the .pkgconf >+# files. >+# Useful for large numbers of configuration files. >+# > # Set the following to specify all documentation your port installs into > # ${DOCSDIR} > # >@@ -2416,12 +2430,20 @@ > _BINOWNGRP= -o ${BINOWN} -g ${BINGRP} > _SHROWNGRP= -o ${SHAREOWN} -g ${SHAREGRP} > _MANOWNGRP= -o ${MANOWN} -g ${MANGRP} >+_CONFOWNGRP= -o ${CONFOWN} -g ${CONFGRP} > .else > _BINOWNGRP= > _SHROWNGRP= > _MANOWNGRP= >+_CONFOWNGRP= > .endif > >+# CONF* macros are only defined in recent versions; these >+# lines can be removed once 8.2-RELEASE is no longer supported. >+CONFOWN?= root >+CONFGRP?= wheel >+CONFMODE?= 644 >+ > # A few aliases for *-install targets > INSTALL_PROGRAM= \ > ${INSTALL} ${COPY} ${STRIP} ${_BINOWNGRP} -m ${BINMODE} >@@ -2435,6 +2457,8 @@ > ${INSTALL} ${COPY} ${_SHROWNGRP} -m ${SHAREMODE} > INSTALL_MAN= \ > ${INSTALL} ${COPY} ${_MANOWNGRP} -m ${MANMODE} >+INSTALL_CONF= \ >+ ${INSTALL} ${COPY} ${_CONFOWNGRP} -m ${CONFMODE} > > INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ > BSD_INSTALL_LIB="${INSTALL_LIB}" \ >@@ -4463,10 +4487,10 @@ > pre-install-script generate-plist check-already-installed > _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ > pre-su-install-script create-users-groups do-install \ >- install-desktop-entries install-license install-rc-script \ >- post-install post-install-script add-plist-info \ >- add-plist-docs add-plist-examples add-plist-data \ >- add-plist-post fix-plist-sequence compress-man \ >+ install-desktop-entries install-license install-conf-files \ >+ install-rc-script post-install post-install-script \ >+ add-plist-info add-plist-docs add-plist-examples \ >+ add-plist-data add-plist-post fix-plist-sequence compress-man \ > install-ldconfig-file fake-pkg security-check > _PACKAGE_DEP= install > _PACKAGE_SEQ= package-message pre-package pre-package-script \ >@@ -5968,6 +5992,45 @@ > .endif > .endif > >+.if !target(install-conf-files) >+install-conf-files: >+. if defined(CONF_FILES) >+ @${ECHO_MSG} "===> Installing configuration file(s)" >+ @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ >+ [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ >+ ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ >+ fi >+. for confs in ${CONF_FILES} >+ @if ${ECHO_CMD} "${confs}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \ >+ if [ ! -e ${PREFIX}/${confs} ] ; then \ >+ ${ECHO_CMD} "@unexec cmp -s %D/${confs}.pkgconf %D/${confs} \ >+ && ${RM} -f %D/${confs} || true" >> ${TMPPLIST} ; \ >+ ${ECHO_CMD} ${confs}.pkgconf >> ${TMPPLIST} ; \ >+ ${ECHO_CMD} "@exec [ -f %D/${confs} ] \ >+ || ${INSTALL_CONF} %D/%F %D/${confs}" \ >+ >> ${TMPPLIST} ; \ >+ [ -f ${PREFIX}/${confs} ] \ >+ || ${INSTALL_CONF} ${PREFIX}/${confs}.pkgconf \ >+ ${PREFIX}/${confs} ; \ >+ fi;fi >+. endfor >+ @for confs in $$( cd ${PREFIX} && ${FIND} -P ${CONF_FILES} ! -type d -and -name *.pkgconf 2>/dev/null ) ; \ >+ do ${ECHO_CMD} "@unexec cmp -s %D/$${confs} %D/$${confs%.pkgconf} \ >+ && ${RM} -f %D/$${confs%.pkgconf} || true" >> ${TMPPLIST} ; \ >+ ${ECHO_CMD} $${confs} >> ${TMPPLIST} ; \ >+ ${ECHO_CMD} "@exec [ -f %D/$${confs%.pkgconf} ] \ >+ || ${INSTALL_CONF} %D/%F %D/$${confs%.pkgconf}" >> ${TMPPLIST} ; \ >+ [ -f ${PREFIX}/$${confs%.pkgconf} ] \ >+ || ${INSTALL_CONF} ${PREFIX}/$${confs} ${PREFIX}/$${confs%.pkgconf} ; \ >+ done >+ @${FIND} -P -d ${CONF_FILES:S/^/${PREFIX}\//} -type d 2>/dev/null | \ >+ ${SED} -ne 's,^.*$$,@unexec rmdir & 2>/dev/null || true,p' \ >+ >> ${TMPPLIST} >+. else >+ ${DO_NADA} >+. endif >+.endif >+ > .if !target(install-rc-script) > install-rc-script: > .if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 157168
:
115397
|
115398
| 115399