head 1.10; access; symbols; locks; strict; comment @# @; 1.10 date 2005.01.18.09.11.23; author thl; state dead; branches; next 1.9; 1.9 date 2004.11.16.11.12.05; author tho; state Exp; branches; next 1.8; 1.8 date 2004.10.20.16.00.20; author rse; state Exp; branches; next 1.7; 1.7 date 2004.10.14.12.54.32; author ms; state Exp; branches; next 1.6; 1.6 date 2004.10.08.16.33.08; author ms; state Exp; branches; next 1.5; 1.5 date 2004.10.07.17.17.12; author ms; state Exp; branches; next 1.4; 1.4 date 2004.10.07.14.46.43; author ms; state Exp; branches; next 1.3; 1.3 date 2004.10.06.08.36.46; author ms; state Exp; branches; next 1.2; 1.2 date 2004.09.24.16.48.33; author ms; state Exp; branches; next 1.1; 1.1 date 2004.09.24.14.08.10; author ms; state Exp; branches; next ; desc @@ 1.10 log @dismantle old build farm status viewing from OpenPKG web server and provide direct links to master @ text @#!/usr/opkg/bin/perl ## ## badstatus.cgi -- Package Build Farm Bad Status Report ## use POSIX qw(strftime); require 5; use IO; $|++; my $O = ''; my $bgcolors = { "CORE" => [qw(#fffff0 #f5f5e5)], "BASE" => [qw(#f0f0f0 #e5e5e5)], "PLUS" => [qw(#eae0d0 #dfd5c5)], "EVAL" => [qw(#f0f0ff #e5e5f5)], "JUNK" => [qw(#fff0f0 #f0e0e0)], }; my $mtime = (stat("status.txt"))[9]; my $updated = strftime("%a %d-%b-%Y %H:%M", localtime($mtime)); my %id2host = ( 'ixFB5' => { -host => 'bsd1', -important => 1 }, 'ixFB4' => { -host => 'bsd2', -important => 1 }, 'amFB5' => { -host => 'bsd3', -important => 0 }, 'iaFB5' => { -host => 'bsd4', -important => 0 }, 'usFB5' => { -host => 'bsd5', -important => 0 }, 'paH11' => { -host => 'eso1', -important => 0 }, 'ppOSX' => { -host => 'eso2', -important => 0 }, 'ixNB2' => { -host => 'eso3', -important => 0 }, 'ixD31' => { -host => 'lnx1', -important => 0 }, 'ixRE3' => { -host => 'lnx2', -important => 1 }, 'ixS92' => { -host => 'lnx3', -important => 1 }, 'ixD30' => { -host => 'lnx4', -important => 1 }, 'ixSE9' => { -host => 'lnx5', -important => 1 }, 'ixSO9' => { -host => 'sol1', -important => 1 }, 'usSO9' => { -host => 'sol2', -important => 1 }, 'usSO8' => { -host => 'sol3', -important => 1 }, 'ixSOX' => { -host => 'sol4', -important => 0 }, 'usSOX' => { -host => 'sol5', -important => 0 }, 'ixG15' => { -host => 'vm40', -important => 1 }, 'ixM10' => { -host => 'vm41', -important => 0 }, 'ixFC3' => { -host => 'vm46', -important => 1 }, ); my $io = new IO::File "\n"; my $ishead = 1; my @@hostlist = (); my @@idlist = (); my @@arch = (); my $class_last = ""; my %doing = (); while ($line = <$io>) { # a2ps 4.13b 20020609 REL yes OK OK ... if ($line =~ m|^===|) { next; } my @@line = split(/\s+/, $line); my ($name, $version, $release, $class, $rel) = @@line[0..4]; if ($ishead) { my @@ids = @@line[5..$#line]; @@idlist = @@ids; $ishead = 0; $O .= "\n"; $O .= "Ok"; $O .= "$name"; $O .= "$version"; $O .= "$release"; $O .= "$class"; $O .= "$rel"; foreach my $id (@@ids) { $O .= "$id"; push(@@hostlist, $id2host{$id}->{-host}); } $O .= "\n"; foreach my $id (@@ids) { my $host = $id2host{$id}->{-host}; my $fn = (glob("status.log/processing.$host.*"))[0] || next; my $mtime = (stat($fn[0]))[9]; #if ($mtime > time()-(10*60)) { my $io = new IO::File "<$fn" or next; $doing{$host} = <$io>; $doing{$host} =~ s|^\s*(\S+).*$|$1|s; $io->close; #} } } else { my @@hosts = @@line[5..$#line]; my $img = "icon-x.gif"; my $ok = 1; my $n = 0; next unless ($class =~ m/(CORE|BASE|PLUS)/); $L = ""; foreach my $host (@@hosts) { my @@log; my $log; unless (defined $arch[$n]) { @@log = glob("status.log/$name-$version-$release.log.".$hostlist[$n].".*"); $log = $log[0]; ($arch[$n]) = ($log =~ /\Q.log.$hostlist[$n].\E(.*)$/); } else { $log = "status.log/$name-$version-$release.log.$hostlist[$n].$arch[$n]"; @@log = ($log) if (-f $log); } $log =~ s|^status.log/||s; #if ( $host eq "--" && # $#log >= 0 && # `tail -1 $log[0]` =~ /^Build End:/) { # $host = "OK"; #} my $important = ($class eq "CORE" or $id2host{$idlist[$n]}->{-important}); if ($host eq "OK") { if (defined($doing{$hostlist[$n]}) and $doing{$hostlist[$n]} eq "$name-$version-$release") { $L .= ""; $L .= "" if ($#log >= 0); $L .= "\"OK\""; $L .= "" if ($#log >= 0); } else { $L .= ""; $L .= "" if ($#log >= 0); $L .= "\"OK\""; $L .= "" if ($#log >= 0); } } elsif ($host eq "FAIL") { $ok = 0 if ($important); if (defined($doing{$hostlist[$n]}) and $doing{$hostlist[$n]} eq "$name-$version-$release") { $L .= ""; $L .= "" if ($#log >= 0); $mtime_srpm = (stat("/e/openpkg/ftp/current/SRC/$name-$version-$release.src.rpm"))[9]; $mtime_logf = (stat($log[0]))[9]; my $img = "icon-dia.gif"; $L .= "\"FAIL\""; $L .= ""; } else { $L .= ""; $L .= "" if ($#log >= 0); $mtime_srpm = (stat("/e/openpkg/ftp/current/SRC/$name-$version-$release.src.rpm"))[9]; $mtime_logf = (stat($log[0]))[9]; my $img = "icon-x.gif"; $img = "icon-star.gif" if ($mtime_logf < $mtime_srpm); $L .= "\"FAIL\""; $L .= ""; } } elsif ($host eq "--") { $ok = 0 if ($important); if (defined($doing{$hostlist[$n]}) and $doing{$hostlist[$n]} eq "$name-$version-$release") { $L .= ""; my $img = "icon-dia.gif"; $L .= "\"--\""; } else { $L .= ""; $L .= "\"--\""; } } $L .= ""; $n++; } $L .= "\n"; if ($ok) { $img = "icon-ok.gif"; } #if ($class_last ne '' and $class_last ne $class) { # $O .= ""; # $O .= "
"; # $O .= "\n"; #} #$class_last = $class; if (not $ok) { $O .= "{$class}->[$odd]."\">\n"; $O .= ""; $O .= ""; $O .= ""; $O .= ""; $O .= ""; $O .= ""; $O .= $L; } } $odd = ($odd + 1) % 2; } $O .= "
\"\"$name$version$release$class$rel
\n"; $io->close(); $O .= "

(last update: $updated)

\n"; ###################################################### my $head = ''; $io = new IO::File "); $io->close(); my $foot = ''; $io = new IO::File "); $io->close(); $O = $head . $O . $foot; $O = "Content-type: text/html\r\n" . sprintf("Content-length: %d\r\n", length($O)) . "\r\n" . $O; print STDOUT $O; exit(0); @ 1.9 log @new hostnames and machines @ text @@ 1.8 log @update for OpenPKG 2.2 @ text @d24 23 a46 22 my %id2host = ( 'ixFB4' => { -host => 'dv1', -important => 1 }, 'ixFB5' => { -host => 'dv2', -important => 1 }, 'ixNB1' => { -host => 'dv20', -important => 0 }, 'ixMLX' => { -host => 'dv5', -important => 0 }, 'ixDL3' => { -host => 'dv6', -important => 1 }, 'ixDLT' => { -host => 'dv32', -important => 0 }, 'ixFC2' => { -host => 'vm46', -important => 1 }, 'ixRE3' => { -host => 'dv23', -important => 1 }, 'ixGL1' => { -host => 'vm40', -important => 0 }, 'ixS90' => { -host => 'dv14', -important => 0 }, 'ixS91' => { -host => 'dv17', -important => 1 }, 'ixSO9' => { -host => 'dv33', -important => 1 }, 'usSV9' => { -host => 'dv34', -important => 0 }, 'usSV8' => { -host => 'dv35', -important => 0 }, 'usSF9' => { -host => 'dv9', -important => 1 }, 'usSO8' => { -host => 'dv8', -important => 1 }, 'ivSOX' => { -host => 'vm47', -important => 0 }, 'usSOX' => { -host => 'dv21', -important => 0 }, 'usSO6' => { -host => 'dv13', -important => 0 }, 'paH11' => { -host => 'dv28', -important => 0 }, ); @ 1.7 log @add dv34, but don't take over dv9's role until Forte developer license is migrated @ text @d37 2 a38 1 'usSO9' => { -host => 'dv34', -important => 1 }, @ 1.6 log @vm40 overtakes dv18 role as Gentoo reference host @ text @d37 1 @ 1.5 log @dv33 replaced dv7 as the Solaris ix86 reference host, and vm10 changed its name to vm47 @ text @d33 1 @ 1.4 log @vm46 replaces dv22 as reference Fedora 2 host @ text @d35 1 a35 1 'ixSO9' => { -host => 'dv7', -important => 1 }, d38 1 a38 1 'ivSOX' => { -host => 'vm10', -important => 0 }, @ 1.3 log @dv32 replaces dv19 as primary buildfarm slave for Debian 3.1 @ text @a26 2 'alFB5' => { -host => 'dv12', -important => 0 }, 'usNB1' => { -host => 'dv3', -important => 0 }, d31 1 a31 2 'ixRL9' => { -host => 'dv4', -important => 0 }, 'ixFC2' => { -host => 'dv22', -important => 1 }, a34 1 'ixGL1' => { -host => 'dv18', -important => 0 }, @ 1.2 log @name correction @ text @d32 1 a32 1 'ixDLT' => { -host => 'dv19', -important => 0 }, @ 1.1 log @track source badstatus.cgi as derived from status.cgi by Thomas LOTTERER @ text @d3 1 a3 1 ## status.cgi -- Package Build Farm Status Report @