File: debian_edu-summary

package info (click to toggle)
sitesummary 0.0.22
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 200 kB
  • ctags: 37
  • sloc: perl: 376; sh: 281; makefile: 57
file content (32 lines) | stat: -rwxr-xr-x 710 bytes parent folder | download | duplicates (10)
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{$_});
    }
}