From c0c15070d120546af3e43654f71b8178b8ddb882 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 3 Aug 2013 15:14:14 -0700 Subject: [PATCH] __repo_key: comment on bash-3.2 compatibility --- bin/isolated-functions.sh | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.26.2