]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
mg-show-flight-runvars: collect rows into @rows, output in second step
authorIan Campbell <ian.campbell@citrix.com>
Mon, 1 Feb 2016 14:28:28 +0000 (14:28 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 8 Feb 2016 16:31:48 +0000 (16:31 +0000)
This will make it easier to collect more rows.

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

index c800110e6587e9470e5f9a37fc66896872c8cec2..820c5778d53f57239918e244b5acdd64e38aa694 100755 (executable)
@@ -46,6 +46,7 @@ die unless @ARGV==1 && $ARGV[0] =~ m/^\w+$/;
 our ($flight) = @ARGV;
 
 our @cols = qw(job name val);
+our @rows;
 
 $flight =~ m/^\d+/ or $flight = "'$flight'";
 my $qfrom = "FROM runvars WHERE flight=$flight AND $synthcond";
@@ -62,6 +63,10 @@ $colws[1] += length $synthsufx;
 while (my (@row) = $q->fetchrow_array()) {
     my $synth = shift @row;
     $row[1] .= $synthsufx if $synth && $synth ne 'f'; # sqlite3 is typeless
-    printf "%-*s %-*s %-*s\n", map { $colws[$_], $row[$_] } qw(0 1 2)
+    push @rows, \@row;
+}
+
+foreach my $row (@rows) {
+    printf "%-*s %-*s %-*s\n", map { $colws[$_], $row->[$_] } qw(0 1 2)
         or die $!;
 }