From: Ian Jackson Subject: [OSSTEST PATCH 2/5] sg-report-flight: Make bodyprint[f] defer the output Date: Tue, 30 Jun 2015 14:49:05 +0100 Message-ID: <1435672148-6183-3-git-send-email-ian.jackson@eu.citrix.com> References: <1435672148-6183-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z9vuf-0007y0-Ug for xen-devel@lists.xenproject.org; Tue, 30 Jun 2015 13:49:26 +0000 In-Reply-To: <1435672148-6183-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 Provide and use variables $header_text and $body_text. Still no functional change. Signed-off-by: Ian Jackson --- sg-report-flight | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sg-report-flight b/sg-report-flight index f9f6e24..bfc8787 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -490,8 +490,11 @@ END }; } -sub bodyprint { print @_ or die $!; } -sub bodyprintf { printf @_ or die $!; } +our $header_text; +our $body_text; + +sub bodyprint { $body_text .= $_ foreach @_; } +sub bodyprintf { my $fmt = shift @_; $body_text .= sprintf $fmt, @_; } sub printversions ($) { my ($thisthat) = @_; @@ -544,9 +547,12 @@ sub print_pushgate_summary () { sub printout { my ($r, @failures) = @_; - bodyprint <{Flight}: $r->{OutcomeSummary} + $header_text = ''; + $body_text = ''; + # Caller expects to provide `Subject: ', so this must come first. + $header_text .= <{Flight}: $r->{OutcomeSummary} END foreach my $include (@includebeginfiles) { STDOUT->flush(); @@ -656,6 +662,8 @@ images: $c{Images} $c{ReportTrailer} END + + print $header_text, "\n", $body_text; } our %heisenjustified; -- 1.7.10.4