diff options
author | rillig <rillig@pkgsrc.org> | 2005-11-15 21:21:01 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-11-15 21:21:01 +0000 |
commit | 74ae2eeea9ce4e57b5bd55bc5ad68b81be4d6d64 (patch) | |
tree | 22aacd79a89d97eb105a31ad192d9bf557e68b2b /mk/bsd.pkg.mk | |
parent | 34676e8431e3b4c504d1a42a4615bdf0fd93083d (diff) | |
download | pkgsrc-74ae2eeea9ce4e57b5bd55bc5ad68b81be4d6d64.tar.gz |
Rewrote the _PATH_CMD command, which could not handle a PATH environment
variable before if it had multiple adjacent white-space characters in
it. Removed the dependency on awk(1), as a simple shell script can do
this job, too. Another change is that all kinds of weird pathnames can
be used for PREPEND_PATH, like /bin, "/bin/Program Files", "/ ",
/foo\ bar, and so on. This had not been possible before, too.
Related to PR 32079.
Ok'ed by jlam.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r-- | mk/bsd.pkg.mk | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index d6047ce56df..81c9e53bd6c 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1750 2005/11/15 18:03:40 gavan Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1751 2005/11/15 21:21:01 rillig Exp $ # # This file is in the public domain. # @@ -918,12 +918,15 @@ _PATH_ORIG:= ${PATH} MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q} .endif -.if !empty(PREPEND_PATH) +.if !empty(PREPEND_PATH:M*) # This is very Special. Because PREPEND_PATH is set with += in reverse order, -# the awk expression reverses the order again (since bootstrap bmake doesn't +# this command reverses the order again (since bootstrap bmake doesn't # yet support the :[-1..1] construct). -_PATH_CMD= ${ECHO} `${ECHO} ${PREPEND_PATH:Q} | ${AWK} '{ORS=":";for (i=NF;i>0;i--) print $$i}'`${_PATH_ORIG} -PATH= ${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation +_PATH_CMD= \ + path=${_PATH_ORIG:Q}; \ + for i in ${PREPEND_PATH}; do path="$$i:$$path"; done; \ + ${ECHO} "$$path" +PATH= ${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation .endif # Add these bits to the environment use when invoking the sub-make |