pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Allow a package to specify the ownership and permis...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/601e02898729
branches:  trunk
changeset: 511909:601e02898729
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Apr 26 05:58:44 2006 +0000

description:
Allow a package to specify the ownership and permission on
${PKG_SYSCONFDIR} if PKG_SYSCONFSUBDIR is defined and non-empty.  A
package may now set PKG_SYSCONFDIR_PERMS to an "owner group mode"
triplet, which defaults to "${ROOT_USER} ${ROOT_GROUP} 755".

diffstat:

 mk/bsd.pkg.mk                |   3 ++-
 mk/install/bsd.pkginstall.mk |  18 +++++++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 5ae0077f22cb -r 601e02898729 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Wed Apr 26 01:48:50 2006 +0000
+++ b/mk/bsd.pkg.mk     Wed Apr 26 05:58:44 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1819 2006/04/24 20:19:03 dillo Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1820 2006/04/26 05:58:44 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -655,6 +655,7 @@
 PKG_SYSCONFBASEDIR=    ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}}
 PKG_SYSCONFDEPOTBASE=  # empty
 .endif
+PKG_SYSCONFDIR_PERMS?= ${ROOT_USER} ${ROOT_GROUP} 755
 
 ALL_ENV+=              PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
 BUILD_DEFS+=           PKG_SYSCONFBASEDIR PKG_SYSCONFDIR
diff -r 5ae0077f22cb -r 601e02898729 mk/install/bsd.pkginstall.mk
--- a/mk/install/bsd.pkginstall.mk      Wed Apr 26 01:48:50 2006 +0000
+++ b/mk/install/bsd.pkginstall.mk      Wed Apr 26 05:58:44 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.49 2006/04/25 22:32:44 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.50 2006/04/26 05:58:47 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and implements the
 # common INSTALL/DEINSTALL scripts framework.  To use the pkginstall
@@ -489,11 +489,23 @@
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
        ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
        ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET}.tmp
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       ${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX};               \
        exec 1>>${.TARGET}.tmp;                                         \
        case ${PKG_SYSCONFSUBDIR:M*:Q}${CONF_FILES:M*:Q}${CONF_FILES_PERMS:M*:Q}"" in \
        "")     ;;                                                      \
-       *)      ${ECHO} "# DIR: ${PKG_SYSCONFDIR:S/${PREFIX}\///} m" ;; \
+       *)      case ${PKG_SYSCONFSUBDIR:M*:Q}"" in                     \
+               "")     ${ECHO} "# DIR: ${PKG_SYSCONFDIR:S/${PREFIX}\///} m" ;; \
+               *)      set -- dummy ${PKG_SYSCONFDIR} ${PKG_SYSCONFDIR_PERMS}; shift; \
+                       while ${TEST} $$# -gt 0; do                     \
+                               dir="$$1"; owner="$$2";                 \
+                               group="$$3"; mode="$$4";                \
+                               shift; shift; shift; shift;             \
+                               dir=`strip_prefix "$$dir"`;             \
+                               ${ECHO} "# DIR: $$dir m $$mode $$owner $$group"; \
+                       done;                                           \
+                       ;;                                              \
+               esac;                                                   \
+               ;;                                                      \
        esac
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        exec 1>>${.TARGET}.tmp;                                         \



Home | Main Index | Thread Index | Old Index