diff mbox series

[OSSTEST,5/9] mg-repro-setup: Break out compute_adjusts

Message ID 20190502174238.23848-6-ian.jackson@eu.citrix.com (mailing list archive)
State Superseded
Headers show
Series mg-repro-flight: Provide --rebuild to make variant build jobs too | expand

Commit Message

Ian Jackson May 2, 2019, 5:42 p.m. UTC
No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 mg-repro-setup | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/mg-repro-setup b/mg-repro-setup
index c8bcad33..10ab65a8 100755
--- a/mg-repro-setup
+++ b/mg-repro-setup
@@ -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