diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-17 06:58:13 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-17 06:58:13 +0000 |
commit | 033e7b68cc5495ab43498a73940be23b919aa5cf (patch) | |
tree | 89224599899494a5eb6352002a13e093db752fb9 | |
parent | 3a2caa9c18864add6b78306aedb0aa73d77a30d5 (diff) | |
download | portage-033e7b68cc5495ab43498a73940be23b919aa5cf.tar.gz portage-033e7b68cc5495ab43498a73940be23b919aa5cf.tar.bz2 portage-033e7b68cc5495ab43498a73940be23b919aa5cf.zip |
Use short substitution syntax in use_with() and use_enable(). Thanks to
Jonathan Callen <abcd@g.o> for this patch.
svn path=/main/trunk/; revision=14623
-rwxr-xr-x | bin/ebuild.sh | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 771d49d2c..63f8bdedb 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -240,15 +240,8 @@ use_with() { return 1 fi - local UW_SUFFIX="" - if [ ! -z "${3}" ]; then - UW_SUFFIX="=${3}" - fi - - local UWORD="$2" - if [ -z "${UWORD}" ]; then - UWORD="$1" - fi + local UW_SUFFIX=${3:+=$3} + local UWORD=${2:-$1} if useq $1; then echo "--with-${UWORD}${UW_SUFFIX}" @@ -265,15 +258,8 @@ use_enable() { return 1 fi - local UE_SUFFIX="" - if [ ! -z "${3}" ]; then - UE_SUFFIX="=${3}" - fi - - local UWORD="$2" - if [ -z "${UWORD}" ]; then - UWORD="$1" - fi + local UE_SUFFIX=${3:+=$3} + local UWORD=${2:-$1} if useq $1; then echo "--enable-${UWORD}${UE_SUFFIX}" |