pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/tv-derecurse]: pkgsrc/mk Simplify and speed up PREPEND_PATH handling.
details: https://anonhg.NetBSD.org/pkgsrc/rev/23db28098387
branches: tv-derecurse
changeset: 483989:23db28098387
user: tv <tv%pkgsrc.org@localhost>
date: Mon Jan 24 19:24:37 2005 +0000
description:
Simplify and speed up PREPEND_PATH handling.
diffstat:
mk/bsd.pkg.mk | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diffs (40 lines):
diff -r 586eea680819 -r 23db28098387 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk Mon Jan 24 19:10:21 2005 +0000
+++ b/mk/bsd.pkg.mk Mon Jan 24 19:24:37 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1540.2.16 2005/01/24 19:10:21 tv Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1540.2.17 2005/01/24 19:24:37 tv Exp $
#
# This file is in the public domain.
#
@@ -25,12 +25,6 @@
_PKG_PHASES_WRKDIR= depends extract patch tools wrapper \
configure build test install package
-# PATH is recalculated below, so save its original incarnation here.
-.if !defined(_PATH_ORIG)
-_PATH_ORIG:= ${PATH}
-MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q}
-.endif
-
############################################################################
# Transform package Makefile variables and set defaults
############################################################################
@@ -1585,12 +1579,14 @@
. endfor
.endif
-PREPEND_PATH?= # empty
-.if !empty(PREPEND_PATH)
+.if !defined(_PATH_ORIG)
+_PATH_ORIG:= ${PATH}
+MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q}
+
# 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
# yet support the :[-1..1] construct).
-_PATH_CMD= ${ECHO} `${ECHO} ${PREPEND_PATH:Q} | ${AWK} '{for (i=NF;i>0;i--) print $$i}'`:${_PATH_ORIG} | ${TR} ' ' :
+_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
.endif
Home |
Main Index |
Thread Index |
Old Index