head	1.30;
access;
symbols;
locks; strict;
comment	@# @;


1.30
date	2005.01.18.09.11.24;	author thl;	state dead;
branches;
next	1.29;

1.29
date	2004.11.22.14.21.22;	author rse;	state Exp;
branches;
next	1.28;

1.28
date	2004.11.16.08.13.12;	author tho;	state Exp;
branches;
next	1.27;

1.27
date	2004.11.15.16.07.16;	author tho;	state Exp;
branches;
next	1.26;

1.26
date	2004.10.20.16.00.19;	author rse;	state Exp;
branches;
next	1.25;

1.25
date	2004.10.14.12.54.32;	author ms;	state Exp;
branches;
next	1.24;

1.24
date	2004.10.08.16.33.08;	author ms;	state Exp;
branches;
next	1.23;

1.23
date	2004.10.07.17.17.12;	author ms;	state Exp;
branches;
next	1.22;

1.22
date	2004.10.07.14.46.43;	author ms;	state Exp;
branches;
next	1.21;

1.21
date	2004.10.06.08.36.46;	author ms;	state Exp;
branches;
next	1.20;

1.20
date	2004.10.01.12.56.51;	author ms;	state Exp;
branches;
next	1.19;

1.19
date	2004.09.24.13.51.30;	author ms;	state Exp;
branches;
next	1.18;

1.18
date	2004.09.23.15.43.33;	author ms;	state Exp;
branches;
next	1.17;

1.17
date	2004.09.23.15.28.27;	author ms;	state Exp;
branches;
next	1.16;

1.16
date	2004.09.23.14.02.33;	author ms;	state Exp;
branches;
next	1.15;

1.15
date	2004.09.10.09.50.17;	author ms;	state Exp;
branches;
next	1.14;

1.14
date	2004.09.09.08.49.19;	author ms;	state Exp;
branches;
next	1.13;

1.13
date	2004.09.09.08.39.23;	author ms;	state Exp;
branches;
next	1.12;

1.12
date	2004.06.14.19.49.50;	author thl;	state Exp;
branches;
next	1.11;

1.11
date	2004.06.07.08.02.21;	author thl;	state Exp;
branches;
next	1.10;

1.10
date	2004.05.14.11.11.57;	author thl;	state Exp;
branches;
next	1.9;

1.9
date	2004.02.21.23.24.04;	author thl;	state Exp;
branches;
next	1.8;

1.8
date	2004.02.21.22.52.07;	author thl;	state Exp;
branches;
next	1.7;

1.7
date	2004.01.21.10.47.11;	author rse;	state Exp;
branches;
next	1.6;

1.6
date	2003.09.16.10.21.12;	author rse;	state Exp;
branches;
next	1.5;

1.5
date	2003.01.29.13.09.46;	author rse;	state Exp;
branches;
next	1.4;

1.4
date	2003.01.22.13.12.54;	author rse;	state Exp;
branches;
next	1.3;

1.3
date	2002.12.19.10.52.43;	author rse;	state Exp;
branches;
next	1.2;

1.2
date	2002.08.09.10.25.06;	author rse;	state Exp;
branches;
next	1.1;

1.1
date	2001.11.15.10.27.32;	author rse;	state Exp;
branches;
next	;


desc
@@


1.30
log
@dismantle old build farm status viewing from OpenPKG web server and provide direct links to master
@
text
@#!/usr/opkg/bin/perl
##
##  status.cgi -- Package Build Farm 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 }, 
    'ixFB6' => { -host => 'vm42', -important => 0 }, 
    'ixM10' => { -host => 'vm41', -important => 0 }, 
    'ixFC3' => { -host => 'vm46', -important => 1 }, 
);

my $io = new IO::File "<status.txt" || die;
my $odd = 0;
$O .= "<table cellspacing=1 cellpadding=2 border=0 width=\"90%\">\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 .= "<tr bgcolor=\"#000000\">\n";
        $O .= "<td align=center><font color=\"#ffffff\">Ok</font></td>";
        $O .= "<td><font color=\"#ffffff\">$name</font></td>";
        $O .= "<td><font color=\"#ffffff\">$version</font></td>";
        $O .= "<td><font color=\"#ffffff\">$release</font></td>";
        $O .= "<td><font color=\"#ffffff\">$class</font></td>";
        $O .= "<td><font color=\"#ffffff\">$rel</font></td>";
        foreach my $id (@@ids) {
            $O .= "<td width=30><font color=\"#ffffff\" size=\"-1\">$id</font></td>";
            push(@@hostlist, $id2host{$id}->{-host});
        }
        $O .= "</tr>\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;
        $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 .= "<td bgcolor=\"#".($important ? "f0f099" : "999933")."\" align=center>";
                    $L .= "<a href=\"status-log.cgi/".$log."\">" if ($#log >= 0);
                    $L .= "<img src=\"status.img/icon-dia.gif\" width=9 height=9 alt=\"OK\" border=0>";
                    $L .= "</a>" if ($#log >= 0);
                }
                else {
                    $L .= "<td bgcolor=\"#".($important ? "99cc99" : "336633")."\" align=center>";
                    $L .= "<a href=\"status-log.cgi/".$log."\">" if ($#log >= 0);
                    $L .= "<img src=\"status.img/icon-ok.gif\" width=9 height=9 alt=\"OK\" border=0>";
                    $L .= "</a>" 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 .= "<td width=30 bgcolor=\"#".($important ? "f0f099" : "999933")."\" align=center>";
                    $L .= "<a href=\"status-log.cgi/".$log."\">" 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 .= "<img src=\"status.img/$img\" width=9 height=9 alt=\"FAIL\" border=0>";
                    $L .= "</a>";
                }
                else {
                    $L .= "<td width=30 bgcolor=\"#".($important ? "ff9999" : "993333")."\" align=center>";
                    $L .= "<a href=\"status-log.cgi/".$log."\">" 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 .= "<img src=\"status.img/$img\" width=9 height=9 alt=\"FAIL\" border=0>";
                    $L .= "</a>";
                }
            }
            elsif ($host eq "--") {
                $ok = 0 if ($important);
                if (defined($doing{$hostlist[$n]}) and $doing{$hostlist[$n]} eq "$name-$version-$release") {
                    $L .= "<td width=30 bgcolor=\"#".($important ? "f0f099" : "999933")."\" align=center>";
                    my $img = "icon-dia.gif";
                    $L .= "<img src=\"status.img/$img\" width=9 height=9 alt=\"--\" border=0>";
                }
                else {
                    $L .= "<td width=30 bgcolor=\"#".($important ? "9999ff" : "000066")."\" align=center>";
                    $L .= "<img src=\"status.img/icon-dot.gif\" width=9 height=9 alt=\"--\" border=0>";
                }
            }
            $L .= "</td>";
            $n++;
        }
        $L .= "</tr>\n";

        if ($ok) {
            $img = "icon-ok.gif";
        }
        #if ($class_last ne '' and $class_last ne $class) {
        #    $O .= "</table>";
        #    $O .= "<br>";
        #    $O .= "<table cellspacing=1 cellpadding=2 border=0 width=\"90%\">\n";
        #}
        #$class_last = $class;
        $O .= "<tr bgcolor=\"".$bgcolors->{$class}->[$odd]."\">\n";
        $O .= "<td align=center><img src=\"status.img/$img\" width=9 height=9 alt=\"\"></td>";
        $O .= "<td><a href=\"ftp://ftp.openpkg.org/current/SRC/$name-$version-$release.src.rpm\"><font color=\"#000000\">$name</font></a></td>";
        $O .= "<td>$version</td>";
        $O .= "<td>$release</td>";
        $O .= "<td>$class</td>";
        $O .= "<td>$rel</td>";
        $O .= $L;

    }
    $odd = ($odd + 1) % 2;
}
$O .= "</table>\n";
$io->close();

$O .= "<p>(last update: $updated)<p>\n";

######################################################

my $head = '';
$io = new IO::File "<status.head.html" || die;
$head .= $_ while (<$io>);
$io->close();

my $foot = '';
$io = new IO::File "<status.foot.html" || die;
$foot .= $_ while (<$io>);
$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.29
log
@add vm42 (ix86-freebsd6.0)
@
text
@@


1.28
log
@fixed copy/paste error
@
text
@d44 1
@


1.27
log
@*** empty log message ***
@
text
@d45 2
a46 1
);  'ixFC3' => { -host => 'vm46', -important => 1 }, 
@


1.26
log
@update for OpenPKG 2.2
@
text
@d25 21
a45 21
    '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.25
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.24
log
@vm40 overtakes dv18 role as Gentoo reference host
@
text
@d37 1
@


1.23
log
@dv33 replaced dv7 as the Solaris ix86 reference host, and vm10 changed its
name to vm47
@
text
@d33 1
@


1.22
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.21
log
@dv32 replaces dv19 as primary buildfarm slave for Debian 3.1
@
text
@d31 1
@


1.20
log
@make consistent with project plan
@
text
@d30 1
a30 1
    'ixDLT' => { -host => 'dv19', -important => 0 },
@


1.19
log
@remove dv16 (ixSOX) as vm10 (ivSOX) has adequately taken its place
@
text
@a26 2
    'alFB5' => { -host => 'dv12', -important => 0 },
    'usNB1' => { -host => 'dv3',  -important => 0 },
a30 2
    'ixRL9' => { -host => 'dv4',  -important => 0 },
    'ixFC2' => { -host => 'dv22', -important => 1 },
a33 1
    'ixGL1' => { -host => 'dv18', -important => 0 },
@


1.18
log
@remove vm9 from build processes, as dv7 is still performing Solaris 9 ix86's
role
@
text
@a41 1
    'ixSOX' => { -host => 'dv16', -important => 0 },
@


1.17
log
@fix cut and paste syntax error
@
text
@a42 1
    'ivSO9' => { -host => 'vm9',  -important => 1 },
@


1.16
log
@consistently handle broken links
@
text
@d138 1
a138 1
                    $L .= "<a href=\"status-log.cgi/".$log."\">"; if ($#log >= 0);
d147 1
a147 1
                    $L .= "<a href=\"status-log.cgi/".$log."\">"; if ($#log >= 0);
@


1.15
log
@correct to work with Buildfarm Makefile (using a strict 'cut -c1-5' command)
@
text
@d138 1
a138 1
                    $L .= "<a href=\"status-log.cgi/".$log."\">";
d147 1
a147 1
                    $L .= "<a href=\"status-log.cgi/".$log."\">";
@


1.14
log
@use different identifications for new virtual machines, testing future role
changes
@
text
@d43 2
a44 2
    'ixSO9v' => { -host => 'vm9',  -important => 1 },
    'ixSOXv' => { -host => 'vm10', -important => 0 },
@


1.13
log
@vm9 and vm10 act as temporary replacements for dv7 and dv16, which will be
phased out and replaced by virtual machines (dv7 is noname box, dv16
hardware/network is unstable)
@
text
@d43 2
a44 2
    'ixSO9' => { -host => 'vm9',  -important => 1 },
    'ixSOX' => { -host => 'vm10', -important => 0 },
@


1.12
log
@adjust importance and remove dv24
@
text
@d43 2
@


1.11
log
@align, resort, update entries for buil farm status page; welcome HPUX
@
text
@d32 1
a32 1
    'ixDLT' => { -host => 'dv19', -important => 1 },
d36 2
a37 2
    'ixS90' => { -host => 'dv14', -important => 1 },
    'ixS91' => { -host => 'dv17', -important => 0 },
a40 1
    'usSO9' => { -host => 'dv24', -important => 1 },
d42 2
a43 2
    'ixSOX' => { -host => 'dv16', -important => 1 },
    'usSOX' => { -host => 'dv21', -important => 1 },
@


1.10
log
@machines in buildfarm changed
@
text
@d40 2
a41 1
    'usSO9' => { -host => 'dv9',  -important => 1 },
d46 1
d112 5
a116 5
            if ( $host eq "--" &&
                 $#log >= 0 &&
                 `tail -1 $log[0]` =~ /^Build End:/) {
                $host = "OK";
            }
@


1.9
log
@$dst is really $class; compute $important only once; reflect fact that CORE is important for all supported platforms (not limited to fully supported platforms)
@
text
@d27 4
a30 1
    'ixDL2' => { -host => 'dv5',  -important => 0 },
d34 1
a34 1
    'ixFC1' => { -host => 'dv22', -important => 1 },
d36 2
a38 2
    'ixSL8' => { -host => 'dv14', -important => 0 },
    'ixSL9' => { -host => 'dv17', -important => 1 },
d43 1
@


1.8
log
@flush version used to create 2.0
@
text
@d50 1
a50 1
my $dst_last = "";
d58 1
a58 1
    my ($name, $version, $release, $dst, $rel) = @@line[0..4];
d68 1
a68 1
        $O .= "<td><font color=\"#ffffff\">$dst</font></td>";
d112 1
d115 1
a115 1
                    $L .= "<td bgcolor=\"#".($id2host{$idlist[$n]}->{-important} ? "f0f099" : "999933")."\" align=center>";
d121 1
a121 1
                    $L .= "<td bgcolor=\"#".($id2host{$idlist[$n]}->{-important} ? "99cc99" : "336633")."\" align=center>";
d128 1
a128 1
                $ok = 0 if ($id2host{$idlist[$n]}->{-important});
d130 1
a130 1
                    $L .= "<td width=30 bgcolor=\"#".($id2host{$idlist[$n]}->{-important} ? "f0f099" : "999933")."\" align=center>";
d139 1
a139 1
                    $L .= "<td width=30 bgcolor=\"#".($id2host{$idlist[$n]}->{-important} ? "ff9999" : "993333")."\" align=center>";
d150 1
a150 1
                $ok = 0 if ($id2host{$idlist[$n]}->{-important});
d152 1
a152 1
                    $L .= "<td width=30 bgcolor=\"#".($id2host{$idlist[$n]}->{-important} ? "f0f099" : "999933")."\" align=center>";
d157 1
a157 1
                    $L .= "<td width=30 bgcolor=\"#".($id2host{$idlist[$n]}->{-important} ? "9999ff" : "000066")."\" align=center>";
d169 1
a169 1
        #if ($dst_last ne '' and $dst_last ne $dst) {
d174 2
a175 2
        #$dst_last = $dst;
        $O .= "<tr bgcolor=\"".$bgcolors->{$dst}->[$odd]."\">\n";
d180 1
a180 1
        $O .= "<td>$dst</td>";
@


1.7
log
@flush pending changes
@
text
@d1 1
a1 1
#!/usr/bin/perl
a23 2
my $major = 9;

d25 16
a40 14
    'ixFB4' => 'dv1',
    'ixFB5' => 'dv2',
    'ixDL2' => 'dv5',
    'ixDL3' => 'dv6',
    'ixDLT' => 'dv19',
    'ixRL9' => 'dv4',
    'ixRA3' => 'dv23',
    'ixSL8' => 'dv14',
    'ixSL9' => 'dv17',
    'ixSO9' => 'dv7',
    'usSO8' => 'dv8',
    'usSO9' => 'dv9',
    'ixSOX' => 'dv16',
    'usSO6' => 'dv13',
d48 1
d61 1
d72 1
a72 1
            push(@@hostlist, $id2host{$id});
d76 1
a76 1
            my $host = $id2host{$id};
d80 1
a80 1
                my $io = new IO::File "<$fn" || next;
d114 1
a114 1
                    $L .= "<td bgcolor=\"#".($n < $major ? "f0f099" : "999933")."\" align=center>";
d120 1
a120 1
                    $L .= "<td bgcolor=\"#".($n < $major ? "99cc99" : "336633")."\" align=center>";
d127 1
a127 1
                $ok = 0 if ($n < $major);
d129 1
a129 1
                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "f0f099" : "999933")."\" align=center>";
d138 1
a138 1
                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "ff9999" : "993333")."\" align=center>";
d149 1
a149 1
                $ok = 0 if ($n < $major);
d151 1
a151 1
                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "f0f099" : "999933")."\" align=center>";
d156 1
a156 1
                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "9999ff" : "000066")."\" align=center>";
@


1.6
log
@flush pending changes
@
text
@d3 1
a3 1
##  status.cgi -- Package Status Report
d7 1
a7 1
require 5.000;
a12 4
#my $STAT => [
#];
# dv1: REL=0/12 EXP=0/2

a16 1
    "PRIV" => [qw(#e0e0e0 #d5d5d5)],
d20 1
d24 19
d47 1
a47 1
my $hostlist = ();
a57 1
    my @@hosts = @@line[5..$#line];
d59 1
d68 3
a70 3
        foreach my $host (@@hosts) {
            $O .= "<td width=30><font color=\"#ffffff\">$host</font></td>";
            push(@@hostlist, $host);
d73 2
a74 1
        foreach my $host (@@hosts) {
d86 1
a86 1

d97 1
a97 1
                ($arch[$n]) = $log =~ /\Q.log.$hostlist[$n].\E(.*)$/;
d100 1
a100 1
                @@log = ( $log ) if -f $log;
d110 16
a125 2
            if ($host eq "--") {
                $ok = 0 if ($n < 9);
d127 1
a127 1
                    $L .= "<td width=30 bgcolor=\"#".($n < 9 ? "f0f099" : "999933")."\" align=center>";
d132 2
a133 1
                    $L .= "<img src=\"status.img/$img\" width=9 height=9 alt=\"--\" border=0>";
d135 2
a136 2
                elsif ($#log >= 0) {
                    $L .= "<td width=30 bgcolor=\"#".($n < 9 ? "ff9999" : "993333")."\" align=center>";
d142 9
d154 2
a155 2
                    $L .= "<td width=30 bgcolor=\"#".($n < 9 ? "9999ff" : "000066")."\" align=center>";
                    $L .= "<img src=\"status.img/icon-dot.gif\" width=9 height=9 alt=\"??\" border=0>";
a156 10
            }
            else {
                $L .= "<td bgcolor=\"#".($n < 9 ? "99cc99" : "336633")."\" align=center>";
                if ($#log >= 0) {
                    $L .= "<a href=\"status-log.cgi/".$log."\">";
                }
                $L .= "<img src=\"status.img/icon-ok.gif\" width=9 height=9 alt=\"OK\" border=0>";
            }
            if ($#log >= 0) {
                $L .= "</a>";
@


1.5
log
@update for latest CURRENT building
@
text
@d6 1
d25 3
d29 2
a30 2
my $n = 0;
$O .= "<table cellspacing=1 cellpadding=2 border=0>\n";
d34 1
d54 1
a54 1
            $O .= "<td><font color=\"#ffffff\">$host</font></td>";
d70 1
a70 1
        $O .= "<tr bgcolor=\"".$bgcolors->{$dst}->[$n]."\">\n";
d73 2
a74 17
        #foreach my $host (@@hosts[0..2]) {
        foreach my $host (@@hosts) {
            if ($host eq "--") {
                $ok = 0;
                last;
            }
        }
        if ($ok) {
            $img = "icon-ok.gif";
        }
        $O .= "<td align=center><img src=\"status.img/$img\" width=9 height=9 alt=\"\"></td>";
        $O .= "<td><a href=\"ftp://ftp.openpkg.org/current/SRC/$name-$version-$release.src.rpm\"><font color=\"#000000\">$name</font></a></td>";
        $O .= "<td>$version</td>";
        $O .= "<td>$release</td>";
        $O .= "<td>$dst</td>";
        $O .= "<td>$rel</td>";
        my $n = 0;
d79 1
a79 1
                @@log = glob("status.log/$name-$version-$release.log.".$hostlist[$n].".*");
d81 1
a81 1
                ($arch[$n]) = $log =~ /.log.\Q$hostlist[$n]\E.(.*)$/;
d87 7
d95 1
d97 2
a98 2
                    $O .= "<td bgcolor=\"#".($n < 6 ? "f0f099" : "999933")."\" align=center>";
                    $O .= "<a href=\"status-log.cgi/".$log."\">";
d102 1
a102 1
                    $O .= "<img src=\"status.img/$img\" width=9 height=9 alt=\"--\" border=0>";
d105 2
a106 2
                    $O .= "<td bgcolor=\"#".($n < 6 ? "ff9999" : "993333")."\" align=center>";
                    $O .= "<a href=\"status-log.cgi/".$log."\">";
d111 1
a111 1
                    $O .= "<img src=\"status.img/$img\" width=9 height=9 alt=\"--\" border=0>";
d114 2
a115 2
                    $O .= "<td bgcolor=\"#".($n < 6 ? "9999ff" : "000066")."\" align=center>";
                    $O .= "<img src=\"status.img/icon-dot.gif\" width=9 height=9 alt=\"??\" border=0>";
d119 1
a119 1
                $O .= "<td bgcolor=\"#".($n < 6 ? "99cc99" : "336633")."\" align=center>";
d121 1
a121 1
                    $O .= "<a href=\"status-log.cgi/".$log."\">";
d123 1
a123 1
                $O .= "<img src=\"status.img/icon-ok.gif\" width=9 height=9 alt=\"OK\" border=0>";
d126 1
a126 1
                $O .= "</a>";
d128 1
a128 1
            $O .= "</td>";
d131 20
a150 1
        $O .= "</tr>\n";
d152 1
a152 1
    $n = ($n + 1) % 2;
d156 2
@


1.4
log
@flush everything prepared for OpenPKG 1.2
@
text
@d99 1
a99 1
                    $O .= "<td bgcolor=\"#".($n < 3 ? "f0f099" : "999933")."\" align=center>";
d107 1
a107 1
                    $O .= "<td bgcolor=\"#".($n < 3 ? "ff9999" : "993333")."\" align=center>";
d116 1
a116 1
                    $O .= "<td bgcolor=\"#".($n < 3 ? "9999ff" : "000066")."\" align=center>";
d121 1
a121 1
                $O .= "<td bgcolor=\"#".($n < 3 ? "99cc99" : "336633")."\" align=center>";
@


1.3
log
@commit pending changes to CVS
@
text
@d29 2
d53 10
d68 2
a69 1
        foreach my $host (@@hosts[0..2]) {
d86 10
a95 2
            my @@log = glob("status.log/$name-$version-$release.log.".$hostlist[$n].".*");
            my $log = $log[0];
d98 10
a107 2
                $O .= "<td bgcolor=\"#".($n < 3 ? "ff9999" : "993333")."\" align=center>";
                if ($#log >= 0) {
d116 2
a117 2
                    #$O .= "<img src=\"status.img/icon-empty.gif\" width=9 height=9 alt=\"??\" border=0>";
                    $O .= "&nbsp;";
@


1.2
log
@new status page
@
text
@d12 11
a22 6
my $bgcolors = [qw(#f0f0f0 #e5e5e5)];
my $okcolors = {
    "REL" => "#ff6666",
    "EXP" => "#f0f000",
    "BRK" => "#ccccff",
    "DEV" => "#f5f5f5",
d28 1
d40 1
d48 1
d53 14
a66 2
        $O .= "<tr bgcolor=\"".$bgcolors->[$n]."\">\n";
        $O .= "<td>$name</td>";
d71 1
d73 3
d77 13
a89 1
                $O .= "<td bgcolor=\"".$okcolors->{$dst}."\">";
d92 8
a99 1
                $O .= "<td bgcolor=\"#99cc99\">";
a100 1
            $O .= $host;
d102 1
@


1.1
log
@add status page
@
text
@d3 1
a3 1
##  status.cgi 
a7 1

d10 1
a10 1
my $page = '';
d12 50
a61 39
open(FP, "<status.head.html");
$page .= $_ while (<FP>);
close(FP);

#########################################################################
my $bgcolor = "ffffff";
my @@array;
my $text0;
my $text1;
my $text2;
my $text3;
my $text4;



$page .= "<table cellspacing=0 cellpadding=0 border=0>\r\n";
open(SFP, "<../SRC/00STATUS");


LOOP:while(<SFP>) {
@@array = ($text0, $text1, $text2, $text3, $text4) = /^(\w+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+/;


$array[0] =~ s|^\s+(.*?)|{$array[0]=$1}|es;   # Remove whitespaces at the beginning
next LOOP if $array[0]  eq "";
next LOOP if $array[0]  =~ /^=/;
$array[0] =~ s|(.*?)\s+$|{$array[0]=$1}|es;       # Remove whitespaces at the end


$page .= sprintf("<tr bgcolor=#%s>\r\n", $bgcolor);


foreach (@@array) {
    $page .= "<td>";
    ($dummy, $_) = ($_ =~ /^(\w+):(\S+)/) if ($_ =~ /^(\w+):(\S+)/); # Remove 1th part to ":"
    if ($_ eq "no") {
       $page .= "<font color=\"#cc3333\">";
    } elsif ($_ eq "yes") {
        $page .= "<font color=\"#33cc33\">";
d63 1
a63 2
    $page .=  "$_";
    $page .= "</td>\r\n";
d65 2
d68 1
d70 16
a85 19
if   ($bgcolor eq "f0f0f0") { $bgcolor = "ffffff"; }
else                        { $bgcolor = "f0f0f0"; }

}

$page .= ("</table>\r\n");

close(SFP);

##########################################################################
open(FP, "<status.foot.html");
$page .= $_ while (<FP>);
close(FP);

$page = "Content-type: text/html\r\n" .
        sprintf("Content-length: %d\r\n", length($page)) .
        "\r\n" . $page;

print STDOUT $page;
@

