From: Ian Jackson Subject: [OSSTEST PATCH 3/6] sg-report-flight: Sort email output by results, not job name Date: Tue, 31 Mar 2015 15:18:42 +0100 Message-ID: <1427811525-14259-4-git-send-email-ian.jackson@eu.citrix.com> References: <1427811525-14259-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Ycx5x-00061H-QV for xen-devel@lists.xenproject.org; Tue, 31 Mar 2015 14:24:45 +0000 In-Reply-To: <1427811525-14259-1-git-send-email-ian.jackson@eu.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: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- sg-report-flight | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sg-report-flight b/sg-report-flight index d2aff58..2adc8a8 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -541,16 +541,21 @@ END my $text= (sprintf" %-${jl}s %2s %-${sl}s %-${rl}s ", $j->{job}, $s->{stepno}, $s->{testid}, $s->{status}); - $text .= "in $failv->{Flight} " if $heisenflightp; - $text .= $failv->{Summary} if defined $failv->{Summary}; + my $xstatus = ''; + $xstatus .= "in $failv->{Flight} " if $heisenflightp; + $xstatus .= $failv->{Summary} if defined $failv->{Summary}; + $text .= $xstatus; $text =~ s/ *$//; while (length($text) > $cw) { last unless $text =~ s/(.* ) /$1/; } - $notsucceeds{$cat} .= $text."\n"; + push @{ $notsucceeds{$cat} }, [ "$s->{status} $xstatus", $text ]; } foreach my $cat (sort keys %notsucceeds) { $cat =~ m/^\w+ / or die; - print "\n$'\n$notsucceeds{$cat}" or die $!; + print "\n$'\n" or die $!; + foreach (sort { $a->[0] cmp $b->[0] } @{ $notsucceeds{$cat} }) { + print $_->[1], "\n" or die $!; + } } if (!%{ $r->{Failures} }) { -- 1.7.10.4