File: debian_edu-summary

package info (click to toggle)
sitesummary 0.0.47
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 264 kB
  • ctags: 71
  • sloc: perl: 931; sh: 386; makefile: 63
file content (32 lines) | stat: -rwxr-xr-x 710 bytes parent folder | download | duplicates (9)
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{$_});
    }
}