]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
mg-show-flight-runvars: include $flight. prefix on job name if -r (recurse)
authorIan Campbell <ian.campbell@citrix.com>
Mon, 1 Feb 2016 14:28:31 +0000 (14:28 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 8 Feb 2016 16:31:48 +0000 (16:31 +0000)
Adds a new -r (==recurse) option which for now only adds "$flight." to
the job name, i.e. nothing is recursive yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
mg-show-flight-runvars

index 0cf4e13f18746b33a3f0a4e29b12c968ec27adca..f96539f40ada1b5bd73842a2f3f84001a85d6e11 100755 (executable)
@@ -27,6 +27,7 @@ csreadconfig();
 
 my $synthcond = '(NOT synth)';
 my $synthsufx = '';
+my $recurse = 0;
 
 for (;;) {
     last unless @ARGV;
@@ -36,6 +37,8 @@ for (;;) {
     if (m/^-a$/) {
        $synthcond = '(1=1)';
        $synthsufx = '~';
+    } elsif (m/^-r$/) {
+       $recurse = 1;
     } else {
        die "$_ ?";
     }
@@ -59,6 +62,7 @@ sub collect ($) {
 
     while (my (@row) = $q->fetchrow_array()) {
        my $synth = shift @row;
+       $row[0] = "$flight.$row[0]" if $recurse;
        $row[1] .= $synthsufx if $synth && $synth ne 'f'; # sqlite3 is typeless
        push @rows, \@row;
     }