[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 2/5] sg-report-flight: Make bodyprint[f] defer the output



Provide and use variables $header_text and $body_text.

Still no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 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 <<END;
-$r->{Flight}: $r->{OutcomeSummary}
+    $header_text = '';
+    $body_text = '';
 
+    # Caller expects to provide `Subject: ', so this must come first.
+    $header_text .= <<END or die $!;
+$r->{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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.