From bd12d127921b4172cd1b9b9fb0b15d47db1563d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= Date: Mon, 31 Oct 2011 22:30:15 +0200 Subject: [PATCH 1/2] makepkg: use the last result for in_opt_array() This allows overriding BUILDENV and OPTIONS easily from within ~/.makepkg.conf, such as: BUILDENV+=(sign distcc) Currently, the first match is used, making such constructions necessary: BUILDENV=(sign distcc "${BUILDENV[@]}") --- scripts/makepkg.sh.in | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 3085bf5..44b3e32 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -302,18 +302,16 @@ check_buildenv() { in_opt_array() { local needle=$1; shift - local opt + local opt res='?' for opt in "$@"; do if [[ $opt = $needle ]]; then - echo 'y' # Enabled - return + res='y' # Enabled elif [[ $opt = "!$needle" ]]; then - echo 'n' # Disabled - return + res='n' # Disabled fi done - echo '?' # Not Found + echo "$res" } -- 1.7.7.1