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

ballombe at cvs.alioth.debian.org ballombe at cvs.alioth.debian.org
Sun Mar 26 18:07:15 UTC 2006


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

Modified Files:
	popcon.pl 
Log Message:
Switch I/O to UTF-8.


Index: popcon.pl
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- popcon.pl	19 Nov 2005 13:17:32 -0000	1.22
+++ popcon.pl	26 Mar 2006 18:07:12 -0000	1.23
@@ -130,7 +130,7 @@
   my (%sum, $me);
   @list = sort {$pkg->{$b}->{$order}<=> $pkg->{$a}->{$order} || $a cmp $b } @list;
   $winner{"$sec/$order"}=$list[0];
-  open DAT , "| tee $popcon/$sec/by_$order | gzip -c > $popcon/$sec/by_$order.gz";
+  open DAT , "|-:utf8", "tee $popcon/$sec/by_$order | gzip -c > $popcon/$sec/by_$order.gz";
   if (defined($list_header{$sec}))
   {
     print DAT $list_header{$sec};
@@ -201,7 +201,7 @@
 for $file ("slink","slink-nonUS","potato","potato-nonUS",
            "woody","woody-nonUS","sarge")
 {
-  open AVAIL, "< $file.sections" or die "Cannot open $file.sections";
+  open AVAIL, "<:utf8", "$file.sections" or die "Cannot open $file.sections";
   while(<AVAIL>)
   {
 	  my ($p,$sec)=split(' ');
@@ -223,7 +223,7 @@
 {
   /([^[:space:]]+)/ or die("incorrect package name");
   $file = $1;#Untaint
-  open AVAIL, "zcat $file|";
+  open AVAIL, "-|:utf8","zcat $file";
   while(<AVAIL>)
   {
 /^Package: (.+)/  and do {$p=$1;$maint{$p}="bug";$source{$p}=$p;next;};
@@ -249,7 +249,7 @@
 #<recent> is the number of people who upgraded this package recently;
 #<no-files> is the number of people whose entry didn't contain enough
 #        information (atime and ctime were 0).
-open PKG, "$results";
+open PKG, "<:utf8","$results";
 while(<PKG>)
 {
   my ($type, at values)=split(" ");
@@ -314,7 +314,7 @@
 
 for $sec (@dists)
 {
-  open HTML , "> $popcon/$sec/index.html";
+  open HTML , ">:utf8", "$popcon/$sec/index.html";
   opendir SEC,"$popcon/$sec";
   &htmlheader;
   printf HTML ("<p>Statistics for the section %-16s sorted by fields: ",$sec);
@@ -338,7 +338,7 @@
 mark "Building by sub-sections pages";
 for $sec (@dists)
 {
-  open HTML , "> $popcon/$sec/first.html";
+  open HTML , ">:utf8", "$popcon/$sec/first.html";
   opendir SEC,"$popcon/$sec";
   &htmlheader;
   printf HTML ("<p>First package in section %-16s for fields: ",$sec);
@@ -375,7 +375,7 @@
 mark "Building winner pages";
 
 {
-	open HTML , "> $popcon/index.html";
+	open HTML , ">:utf8", "$popcon/index.html";
 	&htmlheader;
 	&popconintro;
 	printf HTML ("<p>Statistics for the whole archive sorted by fields: <pre>",$sec);




More information about the Popcon-commits mailing list