cls%seawood.org cccd4baa03 Add 'use strict;' to expose globals.
Remove uses of global $tree & $form.
Remove tabs from showbuilds.pl
Bug #359451 r=bear


git-svn-id: svn://10.0.0.236/trunk@218810 18797224-902f-48f8-a5cc-f745e15eee43
2007-01-23 17:49:10 +00:00

46 lines
1.1 KiB
Perl
Executable File

#! /usr/bin/perl
$tree = 'SeaMonkey';
for $br (last_successful_builds($tree)) {
next unless $br->{buildname} =~ /^$warning_buildnames_pat$/;
my $logfile = "$tree/$br->{logfile}";
if (-e $logfile) {
print "Log previously copied for $br->{buildname}, $logfile\n";
} else {
chdir "$tree";
system("wget", "http://tinderbox.mozilla.org/$logfile");
chdir '..';
print "Log copied for $br->{buildname}, $logfile\n";
}
}
sub last_successful_builds {
my $tree = shift;
my @build_records = ();
my $br;
# tinderbox/globals.pl uses many shameful globals
$form{tree} = $tree;
$maxdate = time;
$mindate = $maxdate - 8*60*60; # Go back 8 hours
print STDERR "Loading build data...";
require 'tbglobals.pl';
tb_load_data(\%form);
print STDERR "done\n";
for (my $ii=0; $ii <= $name_count; $ii++) {
for (my $tt=0; $tt <= $time_count; $tt++) {
if (defined($br = $build_table->[$tt][$ii])
and $br->{buildstatus} eq 'success') {
push @build_records, $br;
last;
} } }
return @build_records;
}