[pacman-dev] [PATCH 1/2] makepkg: allow make-style environment vars to override BUILDSCRIPT vars

Techlive Zheng techlivezheng at gmail.com
Thu Oct 3 03:49:33 EDT 2013


This allows for VAR=value and VAR+=value variable declarations in
command line to override variables in BUILDSCRIPT.
---
 scripts/makepkg.sh.in | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 1ef2af2..f6d884f 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2712,11 +2712,6 @@ if [[ ! -w $BUILDDIR ]]; then
 	exit 1
 fi
 
-# override settings from extra variables on commandline, if any
-if (( ${#extra_environment[*]} )); then
-	export "${extra_environment[@]}"
-fi
-
 PKGDEST=${_PKGDEST:-$PKGDEST}
 PKGDEST=${PKGDEST:-$startdir} #default to $startdir if undefined
 if (( ! (NOBUILD || GENINTEG) )) && [[ ! -w $PKGDEST ]]; then
@@ -2810,7 +2805,11 @@ if [[ $BUILDDIR = "$startdir" ]]; then
 else
 	srcdir="$BUILDDIR/$pkgbase/src"
 	pkgdirbase="$BUILDDIR/$pkgbase/pkg"
+fi
 
+# override settings from extra variables on commandline, if any
+if (( ${#extra_environment[*]} )); then
+	export "${extra_environment[@]}"
 fi
 
 # set pkgdir to something "sensible" for (not recommended) use during build()
-- 
1.8.4



More information about the pacman-dev mailing list