]> xenbits.xensource.com Git - osstest.git/commitdiff
osstest: allow appending to existing runvars
authorIan Jackson <ian.jackson@citrix.com>
Wed, 4 Jul 2018 15:21:15 +0000 (17:21 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 14 Aug 2018 10:07:36 +0000 (11:07 +0100)
So that the contents of the runvar can be expanded. There are
currently two ways to do this:

 - Using += will append to the end of the runvar.
 - Using ,= will append to the end of the runvar using ',' as the
   separator.

Note that if the runvar is empty {,|+}= just sets the runvar.

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
cs-job-create

index 064a92942ebd5bc903ab1af0879110efe6be7e23..1980a6256d060777fb81c09cd16d37992e7a4757 100755 (executable)
@@ -53,8 +53,12 @@ foreach my $rv (@runvars) {
         $suppress{$1}= 1;
         next;
     }
-    $rv =~ m/^([a-z][0-9a-z_]*)(\~?)\=(.*)$/ or die "$rv ?";
-    my ($name,$synth,$val) = ($1,$2,$3);
+    $rv =~ m/^([a-z][0-9a-z_]*)(\~?)([+,]?)\=(.*)$/ or die "$rv ?";
+    my ($name,$synth,$add,$val) = ($1,$2,$3,$4);
+    if ($add && $runvars{$name}) {
+       die "$name synth mismatch" if !!$runvars{$name}[1] ne !!$synth;
+       $val = $runvars{$name}[0].($add ne '+' && $add).$val;
+    }
     $runvars{$name}= [$val,$synth];
 }