summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-06-12 16:30:03 +0000
committerjlam <jlam@pkgsrc.org>2006-06-12 16:30:03 +0000
commitdab443fe1e744757d8d97ac732bdf2049526374e (patch)
treeb7e529289d8109675a74ea1463c8c5166d12e6ea /mk
parentad782541d0e5959bd30aabd247a6c14fe74e5d9f (diff)
downloadpkgsrc-dab443fe1e744757d8d97ac732bdf2049526374e.tar.gz
Move the common make command executed in su-target into a separate make
variable to try to get rid of potential quoting problems.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk14
1 files changed, 10 insertions, 4 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 0875815931a..2d0c831b6ef 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1850 2006/06/11 02:14:45 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1851 2006/06/12 16:30:03 jlam Exp $
#
# This file is in the public domain.
#
@@ -1335,6 +1335,12 @@ real-test: test-message pre-test do-test post-test test-cookie error-check
# reinvoking the make process as root. It acquires root privileges and
# invokes a new make process with the target named "su-${.TARGET}".
#
+_ROOT_CMD= cd ${.CURDIR} && \
+ ${SETENV} PATH="$${PATH}:"${SU_CMD_PATH_APPEND:Q} \
+ ${MAKE} ${MAKEFLAGS} \
+ PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} \
+ su-${.TARGET} ${MAKEFLAGS.${.TARGET}}
+
.PHONY: su-target
su-target: .USE
${_PKG_SILENT}${_PKG_DEBUG}set -e; \
@@ -1343,7 +1349,7 @@ su-target: .USE
*) ${PRE_CMD.su-${.TARGET}} ;; \
esac; \
if ${TEST} `${ID} -u` = `${ID} -u ${ROOT_USER}`; then \
- ${MAKE} ${MAKEFLAGS} PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} su-${.TARGET} ${MAKEFLAGS.${.TARGET}}; \
+ ${_ROOT_CMD}; \
else \
case ${PRE_ROOT_CMD:Q}"" in \
${TRUE:Q}"") ;; \
@@ -1351,8 +1357,8 @@ su-target: .USE
esac; \
${PRE_ROOT_CMD}; \
${STEP_MSG} "Becoming \`\`${ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \
- ${SU_CMD} "cd ${.CURDIR}; ${SETENV} PATH='$${PATH}:${SU_CMD_PATH_APPEND}' ${MAKE} ${MAKEFLAGS} PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL} su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}}"; \
- ${STEP_MSG} "Dropping \`\`${ROOT_USER}'' privileges."; \
+ ${SU_CMD} ${_ROOT_CMD:Q}; \
+ ${STEP_MSG} "Dropping \`\`${ROOT_USER}'' privileges."; \
fi
# Empty pre-* and post-* targets