[Popcon-commits] cvs commit to popularity-contest by ballombe

ballombe at cvs.alioth.debian.org ballombe at cvs.alioth.debian.org
Tue Mar 10 10:34:38 UTC 2009


Update of /cvsroot/popcon/popularity-contest
In directory alioth:/tmp/cvs-serv21114

Modified Files:
	popcon.pl 
Log Message:
Add stable/testing/unstable labels.


Index: popcon.pl
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon.pl,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- popcon.pl	25 Feb 2009 17:38:24 -0000	1.28
+++ popcon.pl	10 Mar 2009 10:34:36 -0000	1.29
@@ -5,6 +5,7 @@
 my $mirrorbase = "/org/ftp.root/debian";
 my $docurlbase = "";
 %popconver=("1.28" => "sarge", "1.41" => "etch", "1.46" => "lenny");
+%popver=();
 
 sub htmlheader
 {
@@ -223,25 +224,35 @@
 mark "Reading legacy packages...";
 $ENV{PATH}="/bin:/usr/bin";
 
-for (glob("$mirrorbase/dists/stable/*/binary-*/Packages.gz"),
-           glob("$mirrorbase/dists/testing/*/binary-*/Packages.gz"),
-           glob("$mirrorbase/dists/sid/*/binary-*/Packages.gz"))
+for $dist ("stable", "testing", "unstable")
 {
-  /([^[:space:]]+)/ or die("incorrect package name");
-  $file = $1;#Untaint
-  open AVAIL, "-|:encoding(UTF-8)","zcat $file";
-  while(<AVAIL>)
+  for (glob("$mirrorbase/dists/$dist/*/binary-*/Packages.gz"))
   {
-/^Package: (.+)/  and do {$p=$1;$maint{$p}="bug";$source{$p}=$p;next;};
-/^Maintainer: ([^()]+) (\(.+\) )*<.+>/ and do { $maint{$p}=join(' ',map{ucfirst($_)} split(' ',lc $1));next;};
-/^Source: (\S+)/ and do { $source{$p}=$1;next;};
-/^Section: (.+)/ or next;
-          $sec=$1;
-          $sec =~ m{^(non-US|contrib|non-free)/} or $sec="main/$sec";
-          $section{$p}=$sec;
+    /([^[:space:]]+)/ or die("incorrect package name");
+    $file = $1;#Untaint
+    open AVAIL, "-|:encoding(UTF-8)","zcat $file";
+    while(<AVAIL>)
+    {
+  /^Package: (.+)/  and do {$p=$1;$maint{$p}="bug";$source{$p}=$p;next;};
+  /^Version: (.+)/ && $p eq "popularity-contest" 
+        and do { $popver{$dist}=$1; next;};
+  /^Maintainer: ([^()]+) (\(.+\) )*<.+>/
+        and do { $maint{$p}=join(' ',map{ucfirst($_)} split(' ',lc $1));next;};
+  /^Source: (\S+)/ and do { $source{$p}=$1;next;};
+  /^Section: (.+)/ or next;
+            $sec=$1;
+            $sec =~ m{^(non-US|contrib|non-free)/} or $sec="main/$sec";
+            $section{$p}=$sec;
+    }
+    close AVAIL;
   }
-  close AVAIL;
 }
+for $dist ("stable", "testing", "unstable")
+{
+  my($v)=$popver{$dist};
+  $popconver{$v}=defined($popconver{$v})?"$popconver{$v}/$dist":$dist;
+}
+
 mark "Reading current packages...";
 
 
@@ -449,10 +460,10 @@
         {
                 my($name) = $f;
                 $name = "$f ($popconver{$f})" if (defined($popconver{$f}));
-                printf HTML "%-16s : %-15s \n",$name,$release{$f};
+                printf HTML "%-25s : %-10s \n",$name,$release{$f};
         }
         if (defined $release{"unknown"}) {
-            printf HTML "%-16s : %-10s \n","unknown",$release{"unknown"};
+            printf HTML "%-25s : %-10s \n","unknown",$release{"unknown"};
         }
 	print HTML  <<'EOF';
 </pre></td>




More information about the Popcon-commits mailing list