From: Zac Medico Date: Sat, 17 Oct 2009 06:58:13 +0000 (-0000) Subject: Use short substitution syntax in use_with() and use_enable(). Thanks to X-Git-Tag: v2.2_rc47~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=033e7b68cc5495ab43498a73940be23b919aa5cf;p=portage.git Use short substitution syntax in use_with() and use_enable(). Thanks to Jonathan Callen for this patch. svn path=/main/trunk/; revision=14623 --- 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}"