Use short substitution syntax in use_with() and use_enable(). Thanks to
authorZac Medico <zmedico@gentoo.org>
Sat, 17 Oct 2009 06:58:13 +0000 (06:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 17 Oct 2009 06:58:13 +0000 (06:58 -0000)
Jonathan Callen <abcd@g.o> for this patch.

svn path=/main/trunk/; revision=14623

bin/ebuild.sh

index 771d49d2cd8e76090847c7ba6096c386642c3da8..63f8bdedb510affa0c1d59f83e442e7a3bc4e30b 100755 (executable)
@@ -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}"