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

popcon-commits@lists.alioth.debian.org popcon-commits@lists.alioth.debian.org
Tue, 15 Feb 2005 11:50:31 -0700


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

Modified Files:
	popcon-stat.pl popcon-process.sh 
Log Message:
popcon-stat.pl, popcon-process.sh: Change the interface to avoid use of xargs
which has a length limit.


Index: popcon-stat.pl
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon-stat.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- popcon-stat.pl	19 Nov 2004 14:51:24 -0000	1.7
+++ popcon-stat.pl	15 Feb 2005 18:50:28 -0000	1.8
@@ -1,15 +1,19 @@
-#! /usr/bin/perl -w
+#! /usr/bin/perl -wT
+
 BEGIN {
 @INC=(@INC, map { "./$_" } @INC);
 }
 
+$ENV{PATH}="/usr/bin:/bin";
 $dirpng="../www/stat";
-for (sort @ARGV)
+while (<>)
 {
-   open FILE,"zcat $_|";
-   m/popcon-([0-9-]+)\.gz$/ or next;
-   $f=$1;
+   my ($file);
+   m/^(.*\/popcon-([0-9-]+)\.gz)$/ or next;
+   $file=$1;
+   $f=$2;
    push @date,$f;
+   open FILE,"zcat $file|";
    while(<FILE>)
    {
      my @line=split(/ +/);

Index: popcon-process.sh
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon-process.sh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- popcon-process.sh	8 Aug 2004 15:30:43 -0000	1.6
+++ popcon-process.sh	15 Feb 2005 18:50:28 -0000	1.7
@@ -20,7 +20,7 @@
 cp ../www/all-popcon-results.txt.gz all-popcon-results/popcon-`date +"%Y-%m-%d"`.gz
 cd ../popcon-stat
 
-find ../popcon-mail/all-popcon-results -type f -print0 | xargs -0 ./popcon-stat.pl
+find ../popcon-mail/all-popcon-results -type f -print | sort |./popcon-stat.pl
 
 cd ../popcon-web
 ./popcon.pl