#! /usr/bin/perl -wT $popcon="."; sub htmlheader { print HTML <<"EOH";
Debian Popularity Contest | ||
Number of submissions considered: $numsub
To participate in this survey: apt-get install popularity-contest
EOF print HTML <Statistics for the section %-16s sorted by fields: ",$sec); for $f (@fields) { print HTML (" $f " ); } print HTML ("\n
\n"); printf HTML ("First packages in subsections for each fields \n"); printf HTML ("
Statistics for subsections sorted by fields\n
\n"); for $dir (sort readdir SEC) { -d "$popcon/$sec/$dir" or next; $dir !~ /^\./ or next; printf HTML ("%-16s : ",$dir); for $f (@fields) { print HTML (" $f " ); } print HTML ("\n"); } &htmlfooter; closedir SEC; close HTML; } for $sec (@dists) { print "html/$sec\n"; open HTML , "> $popcon/$sec/first.html"; opendir SEC,"$popcon/$sec"; &htmlheader; printf HTML ("First package in section %-16s for fields: ",$sec); for $f (@fields) { print_pkg $winner{"$sec/$f"}; } print HTML ("\n
\n"); printf HTML ("Statistics by subsections sorted by fields \n"); printf HTML ("
First package in subsections for fields\n
\n"); printf HTML ("%-16s : ","subsection"); for $f (@fields) { printf HTML ("%-20s ",$f); } print HTML ("\n","_"x120,"\n"); for $dir (sort readdir SEC) { -d "$popcon/$sec/$dir" or next; $dir !~ /^\./ or next; printf HTML ("%-16s : ",$dir); for $f (@fields) { print_pkg $winner{"$sec/$dir/$f"}; } print HTML ("\n"); } &htmlfooter; closedir SEC; close HTML; } { print "html/\n"; open HTML , "> $popcon/index.html"; &htmlheader; printf HTML ("Statistics for the whole archive sorted by fields:
",$sec); for $f (@fields) { print HTML (" $f " ); } print HTML ("\n \n"); printf HTML ("Statistics by maintainers sorted by fields:
",$sec); for $f (@fields) { print HTML (" $f " ); } print HTML ("\n \n"); printf HTML ("Statistics for sections sorted by fields\n
\n"); for $dir ("main","contrib","non-free","non-US","unknown") { -d "$popcon/$dir" or next; $dir !~ /^\./ or next; if ($dir eq "unknown") { printf HTML ("%-16s : ",$dir); } else { printf HTML ("%-16s : ",$dir); } for $f (@fields) { print HTML (" $f " ); } print HTML ("\n"); } &htmlfooter; close HTML; }