From: Neil Brown Date: Tue, 13 Jun 2006 12:57:03 +0000 (+1000) Subject: get_conf was messing up the 'name' variable X-Git-Tag: v0.7~16 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=333a65711d775a5f2efadd1c26a9ebd940c7be2e;p=wiggle.git get_conf was messing up the 'name' variable Signed-off-by: Neil Brown --- diff --git a/p b/p index 4f6d475..5af652b 100755 --- a/p +++ b/p @@ -91,28 +91,28 @@ nl=' ' get_conf() { - name=$1 - context=$2 - result= - active=yes - sep= + _name=$1 + _context=$2 + _result= + _active=yes + _sep= [ -f .patches/config ] || >> .patches/config while read a b c do case $a in - '[global]' ) active=yes ;; - "[$context]") active=yes ;; - "["*"]" ) active= ;; - * ) if [ " $b" == " =" -a " $a" = " $name" -a -n "$active" ]; + '[global]' ) _active=yes ;; + "[$_context]") _active=yes ;; + "["*"]" ) _active= ;; + * ) if [ " $b" == " =" -a " $a" = " $_name" -a -n "$_active" ]; then - result="$result$sep$c" - sep=$nl + _result="$_result$_sep$c" + _sep=$nl fi ;; esac done < .patches/config - result=$(echo "$result" | sed 's/^"//' ) - eval $name=\"\$result\" + _result=$(echo "$_result" | sed 's/^"//' ) + eval $_name=\"\$_result\" } upgrade_one()