From b5cd91f4f08e0e4e699a133b4a3dfe7348e19610 Mon Sep 17 00:00:00 2001 From: "slamm%netscape.com" Date: Wed, 21 Jul 1999 21:09:41 +0000 Subject: [PATCH] Move warnings file to /warnings.html when done. Output warnings summary to /warn.pl. --- webtools/tinderbox/warnings.pl | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/webtools/tinderbox/warnings.pl b/webtools/tinderbox/warnings.pl index b9e83f9791a4..91810d93a7e8 100755 --- a/webtools/tinderbox/warnings.pl +++ b/webtools/tinderbox/warnings.pl @@ -62,13 +62,36 @@ for $br (last_successful_builds($tree)) { $warn_file =~ s/.gz$/.html/; $fh->open(">$warn_file") or die "Unable to open $warn_file: $!\n"; - &print_warnings_as_html($fh, $br); + my ($total_warnings, $time_str) = print_warnings_as_html($fh, $br); $fh->close; - warn "Wrote output to $warn_file\n"; + + # Make it live + use File::Copy 'move'; + move($warn_file, "$tree/warnings.html"); + + my $warn_summary = "$tree/warn$log_file"; + $warn_summary =~ s/.gz$/.pl/; + + $fh->open(">$warn_summary") or die "Unable to open $warn_summary: $!\n"; + $total_warnings = commify($total_warnings); + print $fh '$warning_summary=\'

Check out the ' + ."" + ."$total_warnings Build Warnings (updated $time_str). " + .'-' + .'slamm

\';'."\n"; + $fh->close; + + move($warn_summary, "$tree/warn.pl"); last; } +sub commify { + my $text = reverse $_[0]; + $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; + return scalar reverse $text; +} + # end of main # =================================================================== @@ -264,8 +287,6 @@ sub print_warnings_as_html {

__END_HEADER - warn "$total_warnings_count warnings from $time_str\n"; - for $who (sort { $who_count{$b} <=> $who_count{$a} || $a cmp $b } keys %who_count) { push @who_list, $who; @@ -346,6 +367,8 @@ __END_FOOTER # Change default destination back. select($old_fh); + + return ($total_warnings_count, $time_str); } sub print_count {