User: frankie 
  Date: 06/03/02 12:55:27

  Modified:    .        dgis-status.pl
  Log:
  Added colors for package classes based on version compares.
  
  Revision  Changes    Path
  1.5       +138 -7    scripts/dgis-status.pl
  
  CVSWEB Options: -------------------
  
  CVSWeb: Annotate this file:            
http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/pkg-grass/scripts/dgis-status.pl?annotate=1.5&cvsroot=
  
  CVSWeb: View this file:             
http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/pkg-grass/scripts/dgis-status.pl?rev=1.5&content-type=text/x-cvsweb-markup&cvsroot=
  
  CVSWeb: Diff to previous version:   
http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/pkg-grass/scripts/dgis-status.pl.diff?r1=1.5&r2=1.4&cvsroot=
  
  -----------------------------------
  
  Index: dgis-status.pl
  ===================================================================
  RCS file: /cvsroot/pkg-grass/scripts/dgis-status.pl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- dgis-status.pl    27 Feb 2006 16:09:34 -0000      1.4
  +++ dgis-status.pl    2 Mar 2006 12:55:26 -0000       1.5
  @@ -28,6 +28,10 @@
   use Getopt::Std;
   use FileHandle;
   
  +use AptPkg::Config '$_config';
  +use AptPkg::System '$_system';
  +use AptPkg::Version;
  +
   getopts ('odhvf:');  # -o option: only do difference (no wget)
   our($opt_o, $opt_h, $opt_v, $opt_b, $opt_c, $opt_d, $opt_f);
   
  @@ -120,6 +124,26 @@
        color: #ffffff;
        background-color: #df0451;
   }
  +table.pkg tr.orange {
  +     color: #000000;
  +     background-color: #f09005;
  +}
  +table.pkg tr.yellow {
  +     color: #000000;
  +     background-color: #f0f005;
  +}
  +table.pkg tr.green {
  +     color: #000000;
  +     background-color: #a0f005;
  +}
  +table.pkg tr.red {
  +     color: #000000;
  +     background-color: #f03000;
  +}
  +table.pkg tr.othered {
  +     color: #000000;
  +     background-color: #dc5858;
  +}
   -->
   </style>
      <head>
  @@ -127,6 +151,10 @@
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      </head>
   <body>
  +<p /><em>Go to <a href="http://pkg-grass.alioth.debian.org/";>DebianGis 
Wiki</a></em>
  +<table border=0 cellspacing=10 cellpadding=5>
  +<tr><td valign=top>
  +
   <table class='pkg'>
   <caption><h3>DebianGis Source Packages</h3></caption>
   <tr class='title'>
  @@ -138,18 +166,45 @@
   </tr>
   EOF
   
  +$_config->init;
  +$_system = $_config->system;
  +
  +my $vs = $_system->versioning;
   
   for my $p ( sort keys %dgishash ) {
        next unless $p;
        for my $s ( keys %paths ) {
  -             $dgishash{$p}->{$s} = "none" unless $dgishash{$p}->{$s};
  +             $dgishash{$p}->{$s} = "&nbsp;" unless $dgishash{$p}->{$s};
        }
        my $p_url = $p;
  -     if ( $dgishash{$p}->{stable} ne "none" || $dgishash{$p}->{unstable} ne 
"none" ) {
  +     my $tr_class = "class='green'";
  +     if ( $dgishash{$p}->{stable} ne "&nbsp;" || $dgishash{$p}->{unstable} 
ne "&nbsp;" ) {
                $p_url = "<a 
href='http://packages.qa.debian.org/common/index.html?src=$p'>$p</a>";
        }
  +     if ( $dgishash{$p}->{unstable} ne "&nbsp;" && $dgishash{$p}->{stable} 
eq "&nbsp;" ) {
  +             $tr_class = "class='green'";
  +     }
  +     if ( $dgishash{$p}->{unstable} eq "&nbsp;" && $dgishash{$p}->{stable} 
eq "&nbsp;" && 
  +          $dgishash{$p}->{'dgis-unstable'} eq "&nbsp;" && 
$dgishash{$p}->{'dgis-stable'} ) {
  +             $tr_class = "class='yellow'";
  +     }
  +     if ( $dgishash{$p}->{unstable} ne "&nbsp;" && $dgishash{$p}->{stable} 
ne "&nbsp;" && 
  +          $vs->compare($dgishash{$p}->{unstable},$dgishash{$p}->{stable}) > 
0 ) {
  +             $tr_class = "class='green'";
  +     }
  +     if ( $dgishash{$p}->{unstable} ne "&nbsp;" && 
$dgishash{$p}->{'dgis-unstable'} ne "&nbsp;" && 
  +          
$vs->compare($dgishash{$p}->{unstable},$dgishash{$p}->{'dgis-unstable'}) > 0 ) {
  +             $tr_class = "class='othered'";
  +     }
  +     if ( $dgishash{$p}->{unstable} ne "&nbsp;" && 
$dgishash{$p}->{'dgis-unstable'} ne "&nbsp;" && 
  +          
$vs->compare($dgishash{$p}->{unstable},$dgishash{$p}->{'dgis-unstable'}) < 0 ) {
  +             $tr_class = "class='red'";
  +     }
  +     if ( $dgishash{$p}->{unstable} eq "&nbsp;" && 
$dgishash{$p}->{'dgis-unstable'} ne "&nbsp;" ) {
  +             $tr_class = "class='orange'";
  +     }
        print <<EOF;
  -<tr >
  +<tr $tr_class>
   <td >$p_url</td> 
   <td >$dgishash{$p}->{stable}</td> 
   <td >$dgishash{$p}->{unstable}</td> 
  @@ -162,11 +217,87 @@
   my $now = gmtime;
   
   print <<EOF;
  -     </table>
  +</table>
  +</td>
  +
  +<td valign=top>
  +<table border=0>
  +<caption><h3>Color legend</h3></caption>
  +<tr>
  +<td>
  +<table class='pkg'>
  +<tr class='orange'>
  +<td>&nbsp;</td>
  +</tr>
  +</table>
  +</td>
  +<td>
  +<small>Available in DebianGis, not yet in sid</small>
  +</td>
  +</tr>
  +
  +<tr>
  +<td>
  +<table class='pkg'>
  +<tr class='green'>
  +<td>&nbsp;</td>
  +</tr>
  +</table>
  +</td>
  +<td>
  +<small>Available in Sid, not in stable</small>
  +</td>
  +</tr>
  +
  +<tr>
  +<td>
  +<table class='pkg'>
  +<tr class='yellow'>
  +<td>&nbsp;</td>
  +</tr>
  +</table>
  +</td>
  +<td>
  +<small>Not yet packaged at all</small>
  +</td>
  +</tr>
  +
  +<tr>
  +<td>
  +<table class='pkg'>
  +<tr class='red'>
  +<td>&nbsp;</td>
  +</tr>
  +</table>
  +</td>
  +<td>
  +<small>New in DebianGis, obsolete in sid</small>
  +</td>
  +</tr>
  +
  +<tr>
  +<td>
  +<table class='pkg'>
  +<tr class='othered'>
  +<td>&nbsp;</td>
  +</tr>
  +</table>
  +</td>
  +<td>
  +<small>Obsolete in DebianGis, up-to-date in sid</small>
  +</td>
  +</tr>
  +
  +</td>
  +</tr>
  +</table>
  +</table>
        <p />Status at: $now
        <br />Total of Stable/Unstable/DebianGisStable/DebianGisUnstable 
packages: 
$tot_pkgs{stable}/$tot_pkgs{unstable}/$tot_pkgs{'dgis-stable'}/$tot_pkgs{'dgis-unstable'}
  -     <p />Generated by <a 
href="http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/scripts/dgis-status.pl?cvsroot=pkg-grass&sortby=rev";>this
 GPL licensed perl script</a> 
  -     written by: <a href="mailto:[EMAIL PROTECTED]">Francesco P. 
Lovergine</a> for DebianGis use.
  +     <p /><small>Generated by <a 
href="http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/scripts/dgis-status.pl?cvsroot=pkg-grass&sortby=rev";>this
 GPL licensed perl script</a> 
  +     written by: <a href="mailto:[EMAIL PROTECTED]">Francesco P. 
Lovergine</a> for DebianGis use.</small>
  +     <p />
  +     <p /><em>Go to <a href="http://pkg-grass.alioth.debian.org/";>DebianGis 
Wiki</a></em>
   </body>
   </htmL>
   
  
  
  

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-devel

Reply via email to