From: Ian Jackson Date: Tue, 6 Jun 2017 15:50:37 +0000 (+0100) Subject: cs-adjust-flight: Rework runvar-build-set new value handling X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=497b2c6c933d13a05b01c6a654ce470be16dd78a;p=people%2Fliuw%2Fosstest.git cs-adjust-flight: Rework runvar-build-set new value handling Previously, if it didn't contain a `.', it would be taken as a flight name and completed with the old job name. (This was not documented.) This meant that there was no way to adjust to refer to a differnet job in the flight being manipulated without specifying the flight number (which is not desirable, nor even possible with new:) Instead, we adopt the convention that a trailing . completes the value with the old job name. Values without a . are taken literally as a job name, resulting in intra-flight references to that job. Signed-off-by: Ian Jackson --- diff --git a/cs-adjust-flight b/cs-adjust-flight index 9812d12..03257a6 100755 --- a/cs-adjust-flight +++ b/cs-adjust-flight @@ -32,6 +32,8 @@ # and, is matched against a value # containing the being-manipulated flight name # even if the actual runvar value omits it +# and, if ends in ., it is +# completed with the 's job name # # : # @@ -361,12 +363,11 @@ sub change__runvar_build_set { return unless $name =~ m/buildjob$/; my $oldval = $varrow->{val}; - $oldval = flight_otherjob($dstflight,$oldval); - return unless $oldvalok_fn->($oldval); + my ($oldflt,$oldjob) = flight_otherjob($dstflight,$oldval); + return unless $oldvalok_fn->("$oldflt.$oldjob"); $matches++; - $oldval =~ s/^\d+\.//; # strip out previous flight - my $newval = $specval =~ m/\./ ? $specval : "$specval.$oldval"; + my $newval = $specval =~ m/\.$/ ? "$specval$oldjob": $specval; runvar_set($job, $name, $newval, " (modified from \`$oldval')") if $newval ne $oldval; }, 'IGNORE');