From 4b61d7bd324e4ba4135fba2a8b3c8b1e58f2b996 Mon Sep 17 00:00:00 2001 From: "slamm%netscape.com" Date: Tue, 15 Feb 2000 18:02:27 +0000 Subject: [PATCH] Move build warnings from top of page into build columns. --- webtools/tinderbox/showbuilds.cgi | 20 +++++++++++--------- webtools/tinderbox/tbglobals.pl | 19 +++++++++++++++++++ webtools/tinderbox/warnings.pl | 27 +++++++-------------------- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/webtools/tinderbox/showbuilds.cgi b/webtools/tinderbox/showbuilds.cgi index 663dd5d615c6..4fd1f6d4e5cf 100755 --- a/webtools/tinderbox/showbuilds.cgi +++ b/webtools/tinderbox/showbuilds.cgi @@ -160,12 +160,6 @@ sub do_tinderbox { sub print_page_head { print "Content-type: text/html\n\n\n" unless $form{static}; - # Get the message of the day only on the first pageful - do "$tree/mod.pl" if $nowdate eq $maxdate; - - # Get the warnings summary - do "$tree/warn.pl" if $nowdate eq $maxdate; - use POSIX qw(strftime); # Print time in format, "HH:MM timezone" my $now = strftime("%H:%M %Z", localtime); @@ -175,9 +169,10 @@ sub print_page_head { &print_javascript; + # Get the message of the day only on the first pageful + do "$tree/mod.pl" if $nowdate eq $maxdate; print "$message_of_day\n"; # from $tree/mod.pl - print "$warning_summary\n"; # from $tree/warn.pl - + # Quote and Lengend # unless ($form{nocrap}) { @@ -351,7 +346,6 @@ BEGIN { } # Leak/Bloat - # if (defined $td->{bloaty}{$logfile}) { my ($leaks, $bloat, $leaks_cmp, $bloat_cmp) = @{ $td->{bloaty}{$logfile} }; @@ -359,6 +353,14 @@ BEGIN { "
Bl:", print_bloat_delta($bloat, $bloat_cmp); } + # Warnings + if (defined $td->{warnings}{$logfile}) { + my ($warning_count) = $td->{warnings}{$logfile}; + my $warn_file = "$tree/warn$logfile"; + $warn_file =~ s/\.gz$/.html/; + print "

Warn:$warning_count"; + } + print "\n"; } print "\n"; diff --git a/webtools/tinderbox/tbglobals.pl b/webtools/tinderbox/tbglobals.pl index ed9334272a66..97ae2ce1855a 100755 --- a/webtools/tinderbox/tbglobals.pl +++ b/webtools/tinderbox/tbglobals.pl @@ -131,6 +131,7 @@ sub tb_load_data { &make_build_table($td, $build_list); $td->{bloaty} = load_bloaty($td); + $td->{warnings} = load_warnings($td); return $td; } @@ -396,6 +397,24 @@ sub load_bloaty { return $bloaty; } +# Load data about build warnings +# File format: | +# +sub load_warnings { + my $treedata = $_[0]; + local $_; + + my $warnings = {}; + + open(WARNINGLOG, "<$treedata->{name}/warnings.dat"); + while () { + chomp; + my ($logfile, $warning_count) = split /\|/; + $warnings->{$logfile} = $warning_count; + } + return $warnings; +} + sub get_build_name_index { my ($build_list) = @_; diff --git a/webtools/tinderbox/warnings.pl b/webtools/tinderbox/warnings.pl index 697a17a3df9c..e2aad866345b 100755 --- a/webtools/tinderbox/warnings.pl +++ b/webtools/tinderbox/warnings.pl @@ -139,7 +139,7 @@ print STDERR "done.\n"; # Find the build we want and generate warnings for it # for $br (last_successful_builds($tree)) { - next unless $br->{buildname} =~ /shrike.*\b(Clobber|Clbr)\b/; + next unless $br->{buildname} =~ /^$warning_buildnames_pat$/; my $log_file = "$br->{logfile}"; @@ -183,29 +183,16 @@ for $br (last_successful_builds($tree)) { next unless $total_unignored_warnings > 0; # Make the new warnings live. - use File::Copy 'move'; - move($warn_file, "$tree/warnings.html"); + unlink("$tree/warnings.html"); + symlink($warn_file, "$tree/warnings.html"); - # Print a summary for the main tinderbox page. + # Add an entry to the warning log # - 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_unignored_warnings = commify($total_unignored_warnings); - print $fh '$warning_summary=\'

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

\';'."\n"; + my $warn_log = "$tree/warnings.dat"; + $fh->open(">>$warn_log") or die "Unable to open $warn_log: $!\n"; + print $fh "$log_file|$total_unignored_warnings\n"; $fh->close; - # Make the summary live. - move($warn_summary, "$tree/warn.pl"); - - warn "$total_unignored_warnings warnings ($total_ignored_count ignored)," - ." updated $time_str\n"; - last; }