]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/update-ftpstats
Use string object methods rather than string module.
[dak.git] / scripts / debian / update-ftpstats
1 #!/usr/bin/perl
2
3 my %data;
4 my %data2;
5 my @archs = ("source", "all", "amd64", "i386", "alpha", "arm", "hppa",
6         "hurd-i386", "ia64", "m68k", "mips", "mipsel", "powerpc", "s390",
7         "sparc");
8
9 while (<>) {
10         if (/^(\d{8})\d{6}\|k(?:atie|elly)\|installed\|[^|]+\|[^|]+\|(\d+)\|([-\w]+)$/) {
11                 if (not defined $data{$1}) {
12                         foreach $a (@archs) {
13                                 $data{$1}{$a} = 0;
14                         }
15                 }
16                 $data{$1}{$3} += $2;
17                 $data2{$1}{$3}++;
18         }
19 }
20
21 foreach $p (sort keys %data) {
22         print "$p";
23         foreach $a (@archs) {
24                 print ", $data{$p}{$a}";
25         }
26         print "\n";
27 }