]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
mg-repro-setup: Break out compute_adjusts
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 2 May 2019 13:39:44 +0000 (14:39 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 2 May 2019 17:34:58 +0000 (18:34 +0100)
No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
mg-repro-setup

index c8bcad33f381237def4f1d44a2c329e107c60076..10ab65a80e6c1fc3984e4f8d2170d140ee1f93dd 100755 (executable)
@@ -54,7 +54,6 @@ set -e -o posix
 
 mgexecflags=()
 adjustsets=()
-adjusts=()
 allocs=()
 logfile=tmp/mg-repro-setup.log
 duration=28d
@@ -104,14 +103,17 @@ adjrunvar () {
        delrunvar "$1"
        adjusts+=(runvar-set "$job" "$1" "$2")
 }
-
-for arg in "${adjustsets[@]}"; do
-       case "$arg" in
-       !*|^*)  delrunvar "${arg#?}"            ;;
-       *=*)    adjrunvar "${arg%%=*}" "${arg#*=}"      ;;
-       *)      bad-adjuistset-pattern                  ;;
-       esac
-done
+compute_adjusts () {
+       adjusts=()
+       for arg in "$@"; do
+               case "$arg" in
+               !*|^*)  delrunvar "${arg#?}"            ;;
+               *=*)    adjrunvar "${arg%%=*}" "${arg#*=}"      ;;
+               *)      bad-adjuistset-pattern                  ;;
+               esac
+       done
+}
+compute_adjusts "${adjustsets[@]}"
 
 while [ $# -ne 0 ]; do
        arg=$1; shift