]> err.no Git - dak/commitdiff
New script to update daily architecture install size graph data. [rmurray]
authorJames Troup <james@nocrew.org>
Sat, 20 May 2006 23:53:13 +0000 (18:53 -0500)
committerJames Troup <james@nocrew.org>
Sat, 20 May 2006 23:53:13 +0000 (18:53 -0500)
scripts/debian/update-ftpstats [new file with mode: 0644]

diff --git a/scripts/debian/update-ftpstats b/scripts/debian/update-ftpstats
new file mode 100644 (file)
index 0000000..6627fff
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+my %data;
+my %data2;
+my @archs = ("source", "all", "amd64", "i386", "alpha", "arm", "hppa",
+       "hurd-i386", "ia64", "m68k", "mips", "mipsel", "powerpc", "s390",
+       "sparc");
+
+while (<>) {
+       if (/^(\d{8})\d{6}\|k(?:atie|elly)\|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";
+}