diff options
author | agc <agc> | 1999-03-31 10:59:44 +0000 |
---|---|---|
committer | agc <agc> | 1999-03-31 10:59:44 +0000 |
commit | 510e395c5bb065eeda509ad0c1d98aaed3a4201c (patch) | |
tree | 9445d437f01e57785efa85069e20a568ca1229fb /mk | |
parent | 4faad6f74b11afd6318a8c04ec9f1952e47b0b9f (diff) | |
download | pkgsrc-510e395c5bb065eeda509ad0c1d98aaed3a4201c.tar.gz |
Avoid shell smarts: on NetBSD, type is a sh(1) builtin. If make(1) is
invoked, a subsequent "type make" will give "make is a tracked alias
for /usr/bin/make". Using awk(1) to find the third part of that can
lose. type is also a sh(1) builtin on Solaris, which prints "make is
hashed (/usr/bin/make)". However, there is a separate /usr/bin/type,
which prints the pathname at the end.
Minor reformat in same target - replace spaces by tabs where possible.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index b882125917b..c4fef90b2d3 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.237 1999/03/31 09:57:29 agc Exp $ +# $NetBSD: bsd.pkg.mk,v 1.238 1999/03/31 10:59:44 agc Exp $ # # This file is in the public domain. # @@ -513,6 +513,7 @@ TAIL?= /usr/xpg4/bin/tail TEST?= /usr/bin/test TR?= /usr/bin/tr TRUE?= /usr/bin/true +TYPE?= /usr/bin/type .else AWK?= /usr/bin/awk BASENAME?= /usr/bin/basename @@ -548,6 +549,7 @@ TAIL?= /usr/bin/tail TEST?= /bin/test TR?= /usr/bin/tr TRUE?= /usr/bin/true +TYPE?= type .endif # !SunOS # Used to print all the '===>' style prompts - override this to turn them off. @@ -1098,7 +1100,7 @@ do-configure: .if defined(HAS_CONFIGURE) ${_PKG_SILENT}(${_PKG_DEBUG}cd ${WRKSRC} && ${SETENV} CC="${CC}" ac_cv_path_CC="${CC}" \ CFLAGS="${CFLAGS}" \ - INSTALL="`type ${INSTALL} | ${AWK} '{print($$3)}'` -c -o ${BINOWN} -g ${BINGRP}" \ + INSTALL="`${TYPE} ${INSTALL} | ${AWK} '{ print $$NF }'` -c -o ${BINOWN} -g ${BINGRP}" \ INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}) .endif @@ -1471,22 +1473,22 @@ pkg-su-install: if [ `${ID} -u` = 0 ]; then \ ${MAKE} ${.MAKEFLAGS} root-install; \ else \ - if [ "X${BATCH}" != X"" ]; then \ + if [ "X${BATCH}" != X"" ]; then \ ${ECHO_MSG} "Warning: Batch mode, not superuser, can't run mtree."; \ ${ECHO_MSG} "Become root and try again to ensure correct permissions."; \ - else \ - make=`type ${MAKE} | ${AWK} '{ print $$3 }'`; \ - force=""; \ - if [ "X${FORCE_PKG_REGISTER}" != X"" ]; then \ - force="FORCE_PKG_REGISTER=1"; \ - fi; \ + else \ + make=`${TYPE} ${MAKE} | ${AWK} '{ print $$NF }'`; \ + force=""; \ + if [ "X${FORCE_PKG_REGISTER}" != X"" ]; then \ + force="FORCE_PKG_REGISTER=1"; \ + fi; \ if [ "X${PRE_ROOT_CMD}" != "X" ]; then \ ${ECHO} "*** WARNING *** Running: ${PRE_ROOT_CMD}"; \ - ${PRE_ROOT_CMD}; \ + ${PRE_ROOT_CMD}; \ fi; \ ${ECHO_MSG} "Becoming root to install ${PKGNAME}.";\ ${SU_CMD} "cd ${.CURDIR}; $$make $$force ${.MAKEFLAGS} root-install"; \ - fi; \ + fi; \ fi # Empty pre-* and post-* targets, note we can't use .if !target() |