From: Zac Medico Date: Sat, 3 Aug 2013 22:14:14 +0000 (-0700) Subject: __repo_key: comment on bash-3.2 compatibility X-Git-Tag: v2.2.0_alpha193 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c0c15070d120546af3e43654f71b8178b8ddb882;p=portage.git __repo_key: comment on bash-3.2 compatibility --- diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 6ef8a9163..42d9e708d 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -461,6 +461,10 @@ __repo_key() { while read line; do [[ ${appropriate_section} == 0 && ${line} == "[$1]" ]] && appropriate_section=1 && continue [[ ${appropriate_section} == 1 && ${line} == "["*"]" ]] && appropriate_section=0 && continue + # If a conditional expression like [[ ${line} == $2*( )=* ]] is used + # then bash-3.2 produces an error like the following when the file is + # sourced: syntax error in conditional expression: unexpected token `(' + # Therefore, use a regular expression for compatibility. if [[ ${appropriate_section} == 1 && ${line} =~ ^${2}[[:space:]]*= ]]; then echo "${line##$2*( )=*( )}" exit_status=0