OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-web                      Date:   21-Jan-2004 11:47:11
  Branch: HEAD                             Handle: 2004012110471100

  Modified files:
    openpkg-web             status.cgi

  Log:
    flush pending changes

  Summary:
    Revision    Changes     Path
    1.7         +64 -34     openpkg-web/status.cgi
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-web/status.cgi
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 status.cgi
  --- openpkg-web/status.cgi    16 Sep 2003 10:21:12 -0000      1.6
  +++ openpkg-web/status.cgi    21 Jan 2004 10:47:11 -0000      1.7
  @@ -1,35 +1,50 @@
   #!/usr/bin/perl
   ##
  -##  status.cgi -- Package Status Report
  +##  status.cgi -- Package Build Farm Status Report
   ##
   
   use POSIX qw(strftime);
  -require 5.000;
  +require 5;
   use IO;
   $|++;
   
   my $O = '';
   
  -#my $STAT => [
  -#];
  -# dv1: REL=0/12 EXP=0/2
  -
   my $bgcolors = {
       "CORE" => [qw(#fffff0 #f5f5e5)],
       "BASE" => [qw(#f0f0f0 #e5e5e5)],
       "PLUS" => [qw(#eae0d0 #dfd5c5)],
  -    "PRIV" => [qw(#e0e0e0 #d5d5d5)],
       "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 $major = 9;
  +
  +my %id2host = (
  +    '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',
  +);
  +
   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 @hostlist = ();
   my @arch = ();
   my $dst_last = "";
   my %doing = ();
  @@ -40,8 +55,8 @@
       }
       my @line = split(/\s+/, $line);
       my ($name, $version, $release, $dst, $rel) = @line[0..4];
  -    my @hosts = @line[5..$#line];
       if ($ishead) {
  +        my @ids = @line[5..$#line];
           $ishead = 0;
           $O .= "<tr bgcolor=\"#000000\">\n";
           $O .= "<td align=center><font color=\"#ffffff\">Ok</font></td>";
  @@ -50,12 +65,13 @@
           $O .= "<td><font color=\"#ffffff\">$release</font></td>";
           $O .= "<td><font color=\"#ffffff\">$dst</font></td>";
           $O .= "<td><font color=\"#ffffff\">$rel</font></td>";
  -        foreach my $host (@hosts) {
  -            $O .= "<td width=30><font color=\"#ffffff\">$host</font></td>";
  -            push(@hostlist, $host);
  +        foreach my $id (@ids) {
  +            $O .= "<td width=30><font color=\"#ffffff\" 
size=\"-1\">$id</font></td>";
  +            push(@hostlist, $id2host{$id});
           }
           $O .= "</tr>\n";
  -        foreach my $host (@hosts) {
  +        foreach my $id (@ids) {
  +            my $host = $id2host{$id};
               my $fn = (glob("status.log/processing.$host.*"))[0] || next;
               my $mtime = (stat($fn[0]))[9];
               #if ($mtime > time()-(10*60)) {
  @@ -67,7 +83,7 @@
           }
       }
       else {
  -
  +        my @hosts = @line[5..$#line];
           my $img = "icon-x.gif";
           my $ok = 1;
           my $n  = 0;
  @@ -78,10 +94,10 @@
               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(.*)$/;
  +                ($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 = ($log) if (-f $log);
               }
               $log =~ s|^status.log/||s;
   
  @@ -91,39 +107,53 @@
                   $host = "OK";
               }
   
  -            if ($host eq "--") {
  -                $ok = 0 if ($n < 9);
  +            if ($host eq "OK") {
  +                if (defined($doing{$hostlist[$n]}) and $doing{$hostlist[$n]} eq 
"$name-$version-$release") {
  +                    $L .= "<td bgcolor=\"#".($n < $major ? "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=\"#".($n < $major ? "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 ($n < $major);
                   if (defined($doing{$hostlist[$n]}) and $doing{$hostlist[$n]} eq 
"$name-$version-$release") {
  -                    $L .= "<td width=30 bgcolor=\"#".($n < 9 ? "f0f099" : 
"999933")."\" align=center>";
  +                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "f0f099" : 
"999933")."\" align=center>";
                       $L .= "<a href=\"status-log.cgi/".$log."\">";
                       $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=\"--\" 
border=0>";
  +                    $L .= "<img src=\"status.img/$img\" width=9 height=9 
alt=\"FAIL\" border=0>";
  +                    $L .= "</a>";
                   }
  -                elsif ($#log >= 0) {
  -                    $L .= "<td width=30 bgcolor=\"#".($n < 9 ? "ff9999" : 
"993333")."\" align=center>";
  +                else {
  +                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "ff9999" : 
"993333")."\" align=center>";
                       $L .= "<a href=\"status-log.cgi/".$log."\">";
                       $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 ($n < $major);
  +                if (defined($doing{$hostlist[$n]}) and $doing{$hostlist[$n]} eq 
"$name-$version-$release") {
  +                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "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=\"#".($n < 9 ? "9999ff" : 
"000066")."\" align=center>";
  -                    $L .= "<img src=\"status.img/icon-dot.gif\" width=9 height=9 
alt=\"??\" border=0>";
  +                    $L .= "<td width=30 bgcolor=\"#".($n < $major ? "9999ff" : 
"000066")."\" align=center>";
  +                    $L .= "<img src=\"status.img/icon-dot.gif\" width=9 height=9 
alt=\"--\" border=0>";
                   }
  -            }
  -            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>";
               }
               $L .= "</td>";
               $n++;
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to