From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v1 1/5] mg-show-flight-runvars: collect rows into @rows, output in second step Date: Mon, 1 Feb 2016 14:28:28 +0000 Message-ID: <1454336912-28503-1-git-send-email-ian.campbell@citrix.com> References: <1454336890.28781.99.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1454336890.28781.99.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org This will make it easier to collect more rows. Signed-off-by: Ian Campbell --- mg-show-flight-runvars | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mg-show-flight-runvars b/mg-show-flight-runvars index c800110..820c577 100755 --- a/mg-show-flight-runvars +++ b/mg-show-flight-runvars @@ -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 $!; } -- 2.6.1