From: Zac Medico Date: Sun, 18 Oct 2009 03:57:13 +0000 (-0000) Subject: Use short substitution syntax in use_with() and use_enable(). Thanks to X-Git-Tag: v2.1.7.2~41 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3089c054c523e6b4256cb5b6364eaad23d365160;p=portage.git Use short substitution syntax in use_with() and use_enable(). Thanks to Jonathan Callen for this patch. (trunk r14623) svn path=/main/branches/2.1.7/; revision=14651 --- 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}"