summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-09-17 09:02:17 +0200
committerAllan McRae <allan@archlinux.org>2012-11-27 06:16:15 +0100
commitfbf96203ab4eeb41953022b1dd3f6835fdbf0b6d (patch)
tree7993f8c2f5bdd1af18aac0eab7a6744e03210b30 /scripts/makepkg.sh.in
parentfc35b16fd48fd4c6b89826ebe268425600e76f34 (diff)
downloadpacman-fbf96203ab4eeb41953022b1dd3f6835fdbf0b6d.tar.gz
pacman-fbf96203ab4eeb41953022b1dd3f6835fdbf0b6d.tar.xz
makepkg: use last match in BUILDENV/OPTIONS array
Using the last match in the BUILDENV and OPTIONS arrays allows the user to easily override these values without specifying the entire array. For example add "BUILDENV+=(sign)" in ~/.makepkg.conf. Fixes FS#26701. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d387b7d7..fce75588 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -830,8 +830,9 @@ check_buildenv() {
in_opt_array() {
local needle=$1; shift
- local opt
- for opt in "$@"; do
+ local i opt
+ for (( i = $#; i > 0; i-- )); do
+ opt=${!i}
if [[ $opt = "$needle" ]]; then
# enabled
return 0