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

ballombe at cvs.alioth.debian.org ballombe at cvs.alioth.debian.org
Sat Nov 19 09:30:04 UTC 2005


Update of /cvsroot/popcon/popularity-contest
In directory haydn:/tmp/cvs-serv23479

Modified Files:
	popcon.pl 
Log Message:
Use Packages.gz files now.
Add sarge to precomputed section list.
Fix warning due to missing argument for format.
Use defined instead of exists.


Index: popcon.pl
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon.pl,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- popcon.pl	24 Jul 2005 13:31:05 -0000	1.20
+++ popcon.pl	19 Nov 2005 09:30:02 -0000	1.21
@@ -165,7 +165,7 @@
     $sum{$_}+=$pkg->{$p}->{$_} for (@fields);
   }
   print  DAT '-'x66,"\n";
-  printf DAT $format, $rank, "Total", map {defined($sum{$_})?$sum{$_}:0} @fields;
+  printf DAT $format, $rank, "Total", map {defined($sum{$_})?$sum{$_}:0} @fields, "";
   close DAT;
 }
 
@@ -192,7 +192,8 @@
 %sourcepkg=();
 @fields=("inst","vote","old","recent","no-files");
 
-for $file ("slink","slink-nonUS","potato","potato-nonUS","woody","woody-nonUS")
+for $file ("slink","slink-nonUS","potato","potato-nonUS",
+           "woody","woody-nonUS","sarge")
 {
   open AVAIL, "< $file.sections" or die "Cannot open $file.sections";
   while(<AVAIL>)
@@ -208,12 +209,15 @@
   close AVAIL;
 }
 mark "Reading legacy packages...";
+$ENV{PATH}="/bin:/usr/bin";
 
-for $file (glob("$mirrorbase/dists/stable/*/binary-*/Packages"),
-           glob("$mirrorbase/dists/testing/*/binary-*/Packages"),
-           glob("$mirrorbase/dists/sid/*/binary-*/Packages"))
+for (glob("/org/ftp.root/debian/dists/stable/*/binary-*/Packages.gz"),
+           glob("/org/ftp.root/debian/dists/testing/*/binary-*/Packages.gz"),
+           glob("/org/ftp.root/debian/dists/sid/*/binary-*/Packages.gz"))
 {
-  open AVAIL, "$file";
+  /([^[:space:]]+)/ or die("incorrect package name");
+  $file = $1;#Untaint
+  open AVAIL, "zcat $file|";
   while(<AVAIL>)
   {
 /^Package: (.+)/  and do {$p=$1;$maint{$p}="bug";$source{$p}=$p;next;};
@@ -228,7 +232,6 @@
 }
 mark "Reading current packages...";
 
-$ENV{PATH}="/bin:/usr/bin";
 
 #Format
 #<name> <vote> <old> <recent> <no-files>
@@ -412,7 +415,7 @@
 		$port="kfreebsd-gnu/" if ($port eq "kfreebsd/");
                 printf HTML "<a href=\"http://www.debian.org/ports/$port\">%-16s</a> : %-10s <a href=\"stat/sub-$f.png\">graph</a>\n",$f,$arch{$f};
         }
-        if (exists $arch{"unknown"}) {
+        if (defined $arch{"unknown"}) {
             printf HTML "%-16s : %-10s <a href=\"stat/sub-unknown.png\">graph</a>\n","unknown",$arch{"unknown"}
         }
 	print HTML  <<'EOF';
@@ -429,7 +432,7 @@
         {
                 printf HTML "%-16s : %-10s \n",$f,$release{$f};
         }
-        if (exists $release{"unknown"}) {
+        if (defined $release{"unknown"}) {
             printf HTML "%-16s : %-10s \n","unknown",$release{"unknown"};
         }
 	print HTML  <<'EOF';




More information about the Popcon-commits mailing list