X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fupdate-ftpstats;h=26379bcc42fc30c94ea0d9ec2704a18eb8e1144a;hb=b92562632a64ec38e785278212e43f47c9a0dfef;hp=c2e1355e0e93b533ad7ca7772ce18c12ac2bf6d0;hpb=789833a72e311c714b3029f435c097a84fbf0ad6;p=dak.git diff --git a/scripts/debian/update-ftpstats b/scripts/debian/update-ftpstats index c2e1355e..26379bcc 100755 --- a/scripts/debian/update-ftpstats +++ b/scripts/debian/update-ftpstats @@ -1,24 +1,33 @@ #!/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", +my @archs = ("source", "all", "amd64", "i386", "alpha", "arm", "armel", "armhf", "hppa", "hurd-i386", "ia64", "kfreebsd-amd64", "kfreebsd-i386", "mips", "mipsel", "powerpc", "s390", - "sparc"); + "s390x", "sparc"); -while (<>) { - 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; +for my $file (@ARGV) { + my $FH = new IO::Uncompress::AnyUncompress $file, Transparent => 1 + or warn "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}++; } - $data{$1}{$3} += $2; - $data2{$1}{$3}++; } } -foreach $p (sort keys %data) { +foreach my $p (sort keys %data) { print "$p"; foreach $a (@archs) { print ", $data{$p}{$a}";