Move build warnings from top of page into build columns.

This commit is contained in:
slamm%netscape.com 2000-02-15 18:02:27 +00:00
Родитель d52e3ba999
Коммит 4b61d7bd32
3 изменённых файлов: 37 добавлений и 29 удалений

Просмотреть файл

@ -160,12 +160,6 @@ sub do_tinderbox {
sub print_page_head {
print "Content-type: text/html\n\n<HTML>\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 {
"<br>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 "<br><br><a href='${rel_path}$warn_file'>Warn:$warning_count</a>";
}
print "</tt>\n</td>";
}
print "</tr>\n";

Просмотреть файл

@ -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: <logfile>|<warning_count>
#
sub load_warnings {
my $treedata = $_[0];
local $_;
my $warnings = {};
open(WARNINGLOG, "<$treedata->{name}/warnings.dat");
while (<WARNINGLOG>) {
chomp;
my ($logfile, $warning_count) = split /\|/;
$warnings->{$logfile} = $warning_count;
}
return $warnings;
}
sub get_build_name_index {
my ($build_list) = @_;

Просмотреть файл

@ -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=\'<p>Check out the '
."<a href=\"http://tinderbox.mozilla.org/$tree/warnings.html\">"
."$total_unignored_warnings Build Warnings</a> (updated $time_str). "
.'-<a href="mailto:slamm@netscape.com?subject=About the Build Warnings">'
.'slamm</a><p>\';'."\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;
}