__repo_key: comment on bash-3.2 compatibility v2.2.0_alpha193
authorZac Medico <zmedico@gentoo.org>
Sat, 3 Aug 2013 22:14:14 +0000 (15:14 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 3 Aug 2013 22:14:14 +0000 (15:14 -0700)
bin/isolated-functions.sh

index 6ef8a91638aa48e766ddc4c8193c321a631dd470..42d9e708d52c97432901a43d5c5caa7529287f39 100644 (file)
@@ -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