pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/install Allow for just-in-time su when creating use...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/96947ee32838
branches:  trunk
changeset: 512032:96947ee32838
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sat Apr 29 03:09:40 2006 +0000

description:
Allow for just-in-time su when creating users and groups if
USERGROUP_PHASE is defined.

diffstat:

 mk/install/bsd.pkginstall.mk |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 209ebbb4f67d -r 96947ee32838 mk/install/bsd.pkginstall.mk
--- a/mk/install/bsd.pkginstall.mk      Fri Apr 28 23:17:17 2006 +0000
+++ b/mk/install/bsd.pkginstall.mk      Sat Apr 29 03:09:40 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.50 2006/04/26 05:58:47 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.51 2006/04/29 03:09:40 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and implements the
 # common INSTALL/DEINSTALL scripts framework.  To use the pkginstall
@@ -264,9 +264,9 @@
 
 .if defined(USERGROUP_PHASE)
 .  if !empty(USERGROUP_PHASE:M*configure)
-pre-configure: create-usergroup
+pre-configure: do-su-create-usergroup
 .  elif !empty(USERGROUP_PHASE:M*build)
-pre-build: create-usergroup
+pre-build: do-su-create-usergroup
 .  endif
 .endif
 
@@ -274,13 +274,21 @@
        ${SETENV} PERL5=${PERL5:Q}                                      \
        ${SH} ${PKGSRCDIR}/mk/install/usergroup-check
 
-.PHONY: create-usergroup
-create-usergroup: ${_INSTALL_USERGROUP_UNPACKER}
+.PHONY: do-su-create-usergroup
+do-su-create-usergroup:
+       @${ECHO_MSG} "${_PKGSRC_IN}> Requiring users and groups for ${PKGNAME}"
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        if ${_INSTALL_USERGROUP_CHECK} -g ${_PKG_GROUPS:C/\:*$//} &&    \
           ${_INSTALL_USERGROUP_CHECK} -u ${_PKG_USERS:C/\:*$//}; then  \
                exit 0;                                                 \
        fi;                                                             \
+       realtarget="create-usergroup";                                  \
+       action="create-usergroup";                                      \
+       ${_SU_TARGET}
+
+.PHONY: create-usergroup
+create-usergroup: ${_INSTALL_USERGROUP_UNPACKER}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        cd ${_PKGINSTALL_DIR} &&                                        \
        ${SH} ${_INSTALL_USERGROUP_UNPACKER} &&                         \
        ${TEST} -f ./+USERGROUP &&                                      \



Home | Main Index | Thread Index | Old Index