X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fupdate-ftpstats;h=a7fda09eb58b3400d3acb3afa26e438963e03f5a;hb=0873d6309f8352ffd4331ec373b10dc737b4dfb3;hp=b9febef040e2708d1eab03e36e107ef09c1822c5;hpb=16f731a893f0ba036a995c25b8b5f3490394070e;p=dak.git diff --git a/scripts/debian/update-ftpstats b/scripts/debian/update-ftpstats index b9febef0..a7fda09e 100755 --- a/scripts/debian/update-ftpstats +++ b/scripts/debian/update-ftpstats @@ -1,27 +1,36 @@ #!/usr/bin/perl +use strict; +use warnings; + +use IO::Uncompress::AnyUncompress ":all"; + my %data; my %data2; -my @archs = ("source", "all", "amd64", "i386", "alpha", "arm", "armel", "hppa", - "hurd-i386", "ia64", "mips", "mipsel", "powerpc", "s390", - "sparc"); +my @archs = ("source", "all", "amd64", "i386", "alpha", "arm", "armel", "armhf", "hppa", + "hurd-i386", "ia64", "kfreebsd-amd64", "kfreebsd-i386", "mips", "mipsel", "powerpc", "s390", + "s390x", "sparc"); -while (<>) { - if (/^(\d{8})\d{6}\|(?:k(?:atie|elly)|process-accepted)\|installed\|[^|]+\|[^|]+\|(\d+)\|([-\w]+)$/) { - if (not defined $data{$1}) { - foreach $a (@archs) { - $data{$1}{$a} = 0; - } - } - $data{$1}{$3} += $2; - $data2{$1}{$3}++; - } +for my $file (@ARGV) { + my $FH = new IO::Uncompress::AnyUncompress $file, Transparent => 1 + or die "Cannot open $file: $AnyUncompressError\n"; + while (<$FH>) { + if (/^(\d{8})\d{6}\|(?:k(?:atie|elly)|process-(?:accepted|upload))(?:\|dak)?\|installed\|[^|]+\|[^|]+\|(\d+)\|([-\w]+)$/) { + if (not defined $data{$1}) { + foreach $a (@archs) { + $data{$1}{$a} = 0; + } + } + $data{$1}{$3} += $2; + $data2{$1}{$3}++; + } + } } foreach $p (sort keys %data) { - print "$p"; - foreach $a (@archs) { - print ", $data{$p}{$a}"; - } - print "\n"; + print "$p"; + foreach $a (@archs) { + print ", $data{$p}{$a}"; + } + print "\n"; }