[Popcon-commits] cvs commit to popularity-contest by ballombe
ballombe at cvs.alioth.debian.org
ballombe at cvs.alioth.debian.org
Sat Nov 19 13:17:36 UTC 2005
Update of /cvsroot/popcon/popularity-contest
In directory haydn:/tmp/cvs-serv31045
Modified Files:
popcon.pl
Log Message:
Avoid a bit of code duplication.
Index: popcon.pl
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon.pl,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- popcon.pl 19 Nov 2005 09:30:02 -0000 1.21
+++ popcon.pl 19 Nov 2005 13:17:32 -0000 1.22
@@ -169,6 +169,12 @@
close DAT;
}
+sub make
+{
+ my ($sec,$pkg, at list)=@_;
+ make_sec $sec;
+ make_by ($sec, $_, $pkg, @list) for (@fields);
+}
sub print_pkg
{
my ($pkg)=@_;
@@ -289,8 +295,7 @@
for $sec (@sections)
{
my @list = grep {$section{$_} eq $sec} @pkgs;
- make_sec $sec;
- make_by ($sec, $_, \%pkg, @list) for (@fields);
+ make ($sec, \%pkg, @list);
}
mark "Building by sections pages";
@@ -302,13 +307,11 @@
for $sec (".", at dists)
{
my @list = grep {$section{$_} =~ /^$sec/ } @pkgs;
- make_sec $sec;
- make_by ($sec, $_, \%pkg, @list) for (@fields);
+ make ($sec, \%pkg, @list);
}
-make_sec "maint";
-make_by ("maint", $_, \%maintpkg, @maints) for (@fields);
-make_sec "source";
-make_by ("source", $_, \%sourcepkg, @sources) for (@fields);
+make ("maint", \%maintpkg, @maints);
+make ("source", \%sourcepkg, @sources);
+
for $sec (@dists)
{
open HTML , "> $popcon/$sec/index.html";
More information about the Popcon-commits
mailing list