diff options
author | jlam <jlam> | 2006-06-12 16:30:03 +0000 |
---|---|---|
committer | jlam <jlam> | 2006-06-12 16:30:03 +0000 |
commit | 19a906b576b65e337e87e25788bac212f7074d96 (patch) | |
tree | b7e529289d8109675a74ea1463c8c5166d12e6ea /mk/bsd.pkg.mk | |
parent | 3e8d4eb0a98ff979b9d146f680521ced9eefd664 (diff) | |
download | pkgsrc-19a906b576b65e337e87e25788bac212f7074d96.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/bsd.pkg.mk')
-rw-r--r-- | mk/bsd.pkg.mk | 14 |
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 |