aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Joeris <white@debian.org>2006-09-05 12:48:09 +0000
committerSteffen Joeris <white@debian.org>2006-09-05 12:48:09 +0000
commit7a0521cf2cab8bcd9ea5298e66915ea809a91ca3 (patch)
tree82253ab02005e486974fb69d2b28572378373e6f
parentd4775878704a662f241afdf3e8f7819554992104 (diff)
downloadsitesummary-7a0521cf2cab8bcd9ea5298e66915ea809a91ca3.tar.gz
sitesummary-7a0521cf2cab8bcd9ea5298e66915ea809a91ca3.tar.bz2
sitesummary-7a0521cf2cab8bcd9ea5298e66915ea809a91ca3.tar.xz
* add debian_edu-summary and the subroutine for the package
-rw-r--r--Makefile3
-rw-r--r--SiteSummary.pm30
-rw-r--r--debian/changelog4
-rwxr-xr-xdebian_edu-summary23
-rwxr-xr-xsitesummary-makewebreport2
5 files changed, 59 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 17e5401..2738d29 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,8 @@ COLLECTORS = \
SUMMARYSCRIPTS = \
site-summary \
- kernelversion-summary
+ kernelversion-summary \
+ debian_edu-summary
all:
diff --git a/SiteSummary.pm b/SiteSummary.pm
index 9094c13..1469f5d 100644
--- a/SiteSummary.pm
+++ b/SiteSummary.pm
@@ -12,7 +12,8 @@ our @EXPORT = qw(
get_filepath_current
get_site
get_sitegroup
- get_linux_kernel_ver
+ get_linux_kernel_ver
+ get_debian_edu_ver
);
my $pwd = "/var/lib/sitesummary/entries"; # Path to the entries
@@ -81,6 +82,33 @@ sub get_linux_kernel_ver {
}
}
+sub get_debian_edu_ver {
+# my $hostid = shift;
+ my $debian_edu_config = "/etc/debian-edu/config";
+ if ( ! -e $debian_edu_config ) {
+ print STDERR "error: Missing $debian_edu_config file.\n";
+ return undef;
+ }
+ my $profiles = "Main-Server Workstation Thin-Client-Server Standalone";
+ my @profile = split(/ /, $profiles);
+ open(FILE, $debian_edu_config) or die "$!: $debian_edu_config\nDied";
+ while ( my @config = <FILE> ) {
+ if ( "@config" =~ "$profile[0]" ) {
+ return $profile[0];
+ }elsif ( "@config" =~ "$profile[1]" ) {
+ return $profile[1];
+ }elsif ( "@config" =~ "$profile[2]" ) {
+ return $profile[2];
+ }elsif ( "@config" =~ "$profile[3]" ) {
+ return $profile[3];
+ }else{
+ print STDERR "error: Can't determine debian-edu profile.\n";
+ return undef;
+ }
+ }
+ close(FILE);
+}
+
sub for_all_hosts {
my $callback = shift;
diff --git a/debian/changelog b/debian/changelog
index 0cdd3be..bffc0ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,10 @@ sitesummary (0.0.8) terra; urgency=low
[ Steffen Joeris ]
* Add missing dependency for sitesummary against apache2-common
which is needed for a2dissite in the postinst script
+ * Write subroutine for debian_edu_vers which is needed for the
+ debian-edu report
+ * Add debian_edu-summary script and adjust Makefile and the
+ sitesummary-makewebreport script
-- Steffen Joeris <steffen.joeris@skolelinux.de> Tue, 5 Sep 2006 21:21:24 +1000
diff --git a/debian_edu-summary b/debian_edu-summary
new file mode 100755
index 0000000..51ca62b
--- /dev/null
+++ b/debian_edu-summary
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use SiteSummary;
+
+my %debian_edu_vers;
+my $edu_ver;
+
+#for_all_hosts(\&handle_host);
+
+print_summary();
+handle_host();
+sub handle_host {
+# my $hostid = shift;
+ foreach ( get_debian_edu_ver ) {
+ print "$_\n";
+ }
+}
+
+sub print_summary {
+ printf(" %-20s %5s\n", "debian-edu-version", "count");
+}
diff --git a/sitesummary-makewebreport b/sitesummary-makewebreport
index 681f460..67bd694 100755
--- a/sitesummary-makewebreport
+++ b/sitesummary-makewebreport
@@ -15,7 +15,7 @@ cat <<EOF
<pre>
EOF
-for f in site-summary kernelversion-summary ; do
+for f in site-summary kernelversion-summary debian_edu-summary ; do
/usr/lib/sitesummary/$f
echo
done