aboutsummaryrefslogtreecommitdiffstats
path: root/debian_edu-summary
blob: 10e55d6fcddb057682e59b67c1371496ab357daf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl -w

use strict;

use SiteSummary;
my %profiles;
my %versions;

for_all_hosts(\&handle_host);

print_summary();

exit 0;

sub handle_host {
    my $hostid = shift;
    my $profile = get_debian_edu_profile($hostid);
    my $version = get_debian_edu_ver($hostid);
    $profiles{$profile}++ if (defined $profile);
    $versions{$version}++ if (defined $version);
}

sub print_summary {
    printf("  %-30s %5s\n", "debian-edu-profile", "count");
    foreach ( keys %profiles ) {
    	printf(" %30s %5s\n", $_ || "n/a", $profiles{$_});
    }
    printf("  %-30s %5s\n", "debian-edu-version", "count");
    foreach ( keys %versions ) {
    	printf(" %30s %5s\n", $_ || "n/a", $versions{$_});
    }
}