summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2006-04-29 03:09:40 +0000
committerjlam <jlam>2006-04-29 03:09:40 +0000
commit99cf98a0c06dfbd7c6a30a84f9a147f95fdb7739 (patch)
tree0afaf12afd4a2bf44387eec88ea36f8952b1de47
parentde636b5a3a98d95d3fd6c94a3924a09d2c0b4bb8 (diff)
downloadpkgsrc-99cf98a0c06dfbd7c6a30a84f9a147f95fdb7739.tar.gz
Allow for just-in-time su when creating users and groups if
USERGROUP_PHASE is defined.
-rw-r--r--mk/install/bsd.pkginstall.mk18
1 files changed, 13 insertions, 5 deletions
diff --git a/mk/install/bsd.pkginstall.mk b/mk/install/bsd.pkginstall.mk
index 80a08b0fdb5..2c2df47d95d 100644
--- a/mk/install/bsd.pkginstall.mk
+++ b/mk/install/bsd.pkginstall.mk
@@ -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 @@ ${_INSTALL_USERGROUP_UNPACKER}: \
.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 @@ _INSTALL_USERGROUP_CHECK= \
${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 && \