FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 09-17-2012, 07:04 AM
Allan McRae
 
Default 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>
---
doc/makepkg.conf.5.txt | 6 ++++--
scripts/makepkg.sh.in | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt
index 3dbaea1..cf9da73 100644
--- a/doc/makepkg.conf.5.txt
+++ b/doc/makepkg.conf.5.txt
@@ -81,7 +81,8 @@ Options
This array contains options that affect the build environment, the defaults
are shown here. All options should always be left in the array; to enable
or disable an option simply remove or place an ``!' at the front of the
- option. Each works as follows:
+ option. If an option is specified multiple times, the final value takes
+ precedence. Each option works as follows:

*fakeroot*;;
Allow building packages as a non-root user. This is highly recommended.
@@ -134,7 +135,8 @@ Options
equivalent to options that can be placed in the PKGBUILD; the defaults are
shown here. All options should always be left in the array; to enable or
disable an option simply remove or place an ``!' at the front of the
- option. Each works as follows:
+ option. If an option is specified multiple times, the final value takes
+ precedence. Each option works as follows:

*strip*;;
Strip symbols from binaries and libraries. If you frequently use a
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d387b7d..fce7558 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
--
1.7.12
 

Thread Tools




All times are GMT. The time now is 12:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org