]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
cs-adjust-flight: Rework runvar-build-set new value handling
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 6 Jun 2017 15:50:37 +0000 (16:50 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 12 Jun 2017 13:29:47 +0000 (14:29 +0100)
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 <Ian.Jackson@eu.citrix.com>
cs-adjust-flight

index 9812d12e46510f04c1bfb6ae1f2d34bd2ea75ed2..03257a6221148a001ffae36764fbfa979386d300 100755 (executable)
@@ -32,6 +32,8 @@
 #                   and, <old-value> is matched against a value
 #                    containing the being-manipulated flight name
 #                    even if the actual runvar value omits it
+#                   and, if <new-value> ends in ., it is
+#                    completed with the <old-value>'s job name
 #
 # <dst-flight>:
 #   <flight>
@@ -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');