From: Ian Jackson Date: Wed, 17 Apr 2019 11:11:51 +0000 (+0100) Subject: mg-repro-setup: Allow, and advertise, ^ for unsetting runvars X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c744d0f3defaeec69a42708fb72f0dc1a63b8c5c;p=people%2Fiwj%2Fosstest.git mg-repro-setup: Allow, and advertise, ^ for unsetting runvars This avoids any possible problems with shells misinterpreting ! and is consistent with the other recent changes replacing ! for negation with ^. Signed-off-by: Ian Jackson --- diff --git a/mg-repro-setup b/mg-repro-setup index aa93c0ea..37ccb59d 100755 --- a/mg-repro-setup +++ b/mg-repro-setup @@ -37,7 +37,7 @@ usage () { cat <= set runvar - -r! delete runvar + -r^ delete runvar -B default is 'play' -E... -f... -P as for mg-execute-flight --autoalloc-nofree allocate hosts as for production, but keep them @@ -77,7 +77,9 @@ while true; do --capture) skipcapture=false ;; --autoalloc-nofree) autoalloc=true ;; -l*) logfile=${arg#-l} ;; - -r!*) adjustsets+=("${arg#-r}") ;; + -r^*|-r!*) adjustsets+=("${arg#-r}") ;; + # ^ two patterns because there's no way in bash to write + # a glob character class which matches exactly ^ or ! -r*=*) adjustsets+=("${arg#-r}") ;; --) break ;; *) badusage ;; @@ -105,7 +107,7 @@ adjrunvar () { for arg in "${adjustsets[@]}"; do case "$arg" in - !*) delrunvar "${arg#!}" ;; + !*|^*) delrunvar "${arg#?}" ;; *=*) adjrunvar "${arg%%=*}" "{$arg#*=}" ;; *) bad-adjuistset-pattern ;; esac