diff options
author | Simon Paillard <spaillard> | 2009-09-09 19:36:32 +0000 |
---|---|---|
committer | Simon Paillard <spaillard> | 2009-09-09 19:36:32 +0000 |
commit | 4545c180ed1a05a4d6cca3ac622835b31df60551 (patch) | |
tree | a2cb3fb389dd25829592ba2bc367b85e933045cb /english/mirror/arch_size.pl | |
parent | 0a1f15a922b890cd6660e8ca8c420e4cf0452454 (diff) |
Sort mirror size: first source, then arch indep, then sorted archs, then sum
CVS version numbers
english/mirror/arch_size.pl: 1.2 -> 1.3
Diffstat (limited to 'english/mirror/arch_size.pl')
-rwxr-xr-x | english/mirror/arch_size.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/english/mirror/arch_size.pl b/english/mirror/arch_size.pl index 14854549b7a..dc6f6e1fe57 100755 --- a/english/mirror/arch_size.pl +++ b/english/mirror/arch_size.pl @@ -19,19 +19,26 @@ my $arch_space = $res->content; my $total ; +my $space; + for my $line (split("\n",$arch_space)) { if ($line =~ /^([\w-]+)\s*\|(\d+)\s*$/) { my $size = $2/1000000000; $total += $2 ; - printf "<tr><td>$1</td>\t<td>%.0f</td></tr>\n", $size ; + $space->{$1}=$size; } if ($line =~ /^(\d+)$/) { my $size = $1/1000000000; $total += $1 ; - printf "<tr><td>source</td>\t<td>%.0f</td></tr>\n", $size ; + $space->{'source'}=$size; } } +printf "<tr><td>source</td>\t<td>%.0f</td></tr>\n", $space->{"source"}; + +foreach my $key (sort keys %$space) { + printf "<tr><td>$key</td>\t<td>%.0f</td></tr>\n", $space->{$key} unless ($key eq "source"); +} $total /= 1000000000 ; printf "<tr><td>Total</td>\t<td>%.0f</td></tr>\n", $total ; |