summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-18 03:57:13 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-18 03:57:13 +0000
commit3089c054c523e6b4256cb5b6364eaad23d365160 (patch)
treeb19ef5d9a677d66ce8a4f6f1e566142b74a6e874
parentd5b0cd1a5e8ff576b126ca73a062b791ada16cf7 (diff)
downloadportage-3089c054c523e6b4256cb5b6364eaad23d365160.tar.gz
portage-3089c054c523e6b4256cb5b6364eaad23d365160.tar.bz2
portage-3089c054c523e6b4256cb5b6364eaad23d365160.zip
Use short substitution syntax in use_with() and use_enable(). Thanks to
Jonathan Callen <abcd@g.o> for this patch. (trunk r14623) svn path=/main/branches/2.1.7/; revision=14651
-rwxr-xr-xbin/ebuild.sh22
1 files changed, 4 insertions, 18 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index e7236a0c1..347ba7d64 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}"