or die "Could not get host list";
print "Got list:\n$hostlist\n" if $debug>2;
-my $table = "<table>\n";
+
+# Statistics
my %summary;
my %sechosts;
my %secpkgs;
+my %ownhosts;
+my %ownpkgs;
+my %normhosts;
+my %normpkgs;
+my %okhosts;
+my %skiphosts;
+
+my $table = "<table>\n";
+
for $hline ( split("\n",$hostlist) ) {
next unless ( $hline =~ /\/([a-z0-9]+)\.cfg$/ );
my $H = $1;
if ( !$apt ) {
$table .= "<tr><td colspan='3'> </td></tr>\n";
$table .= "<tr><td colspan='3'><b><u>$H</u></b> (skipped)\n";
+ $skiphosts{$H}=1;
next;
}
print "Got apts for $H: \n$apt\n" if $debug>2;
} elsif ( $src =~ /Indexdata/ ) {
$det .= "<b><i>$pkg</i></b>";
$key = "<i>$pkg</i>";
+ $ownhosts{$H}=1;
+ $ownpkgs{$pkg}=1;
$own++;
} else {
$det .= "$pkg";
+ $normhosts{$H}=1;
+ $normpkgs{$pkg}=1;
}
if ( !$summary{$key} ) {
$summary{$key} = "";
$det .= "</tr>\n";
}
$table .= "<tr><td colspan='3'> </td></tr>\n";
- $table .= "<tr><td colspan='3'><b><u>$H</u></b> \n";
+ $table .= "<tr><td colspan='3'><a name='$H'><b><u>$H</u></b></a> \n";
if ( $pkgs ) {
$table .= "<b>$pkgs</b> packages to upgrade. ";
$table .= "<b>$secs security</b>. " if $secs;
print F "<body>\n";
print F "<H1>Apt package status</H1>\n";
-if ( %sechosts ) {
- print F "<h2>Security updates for " .
- scalar(keys(%sechosts)) ." hosts: </h2>\n";
- print F "<b>" . join(" ", sort(keys(%sechosts)))."</b><br/> ".
- join(" ", sort(keys(%secpkgs))). "<p/>\n";
+
+# Summary table
+print F "<table border='1' >\n";
+print F "<tr><td> </td>" ;
+print F "<td><b>Security:</b> " . scalar(keys(%sechosts)) .
+ " / " . scalar(keys(%secpkgs)) . " </td>\n" ;
+print F "<td>Indexdata: " . scalar(keys(%ownhosts)) .
+ " / " . scalar(keys(%ownpkgs)) . " </td>\n" ;
+print F "<td>Normal: " . scalar(keys(%normhosts)) .
+ " / " . scalar(keys(%normpkgs)) . " </td>" . "</tr>\n";
+print F "<tr><td>Hosts</td>\n";
+
+
+print F "<td>";
+for $HH ( sort(keys(%sechosts)) ) {
+ print F "<a href='#$HH'><b>$HH</b></a> ";
+}
+print F " </td>\n";
+#print F "<td><b>" . join(" ",sort(keys(%sechosts))) . "</b> </td>";
+#print F "<td><b>" . join(" ",sort(keys(%ownhosts))) . "</b> </td>";
+print F "<td>";
+for $HH ( sort(keys(%ownhosts)) ) {
+ print F "<a href='#$HH'><b>$HH</b></a> ";
}
+print F " </td>\n";
+#print F "<td><b>" . join(" ",sort(keys(%normhosts))) . "</b> </td></tr>\n";
+print F "<td>";
+for $HH ( sort(keys(%normhosts)) ) {
+ print F "<a href='#$HH'><b>$HH</b></a> ";
+}
+print F " </td>\n";
+
+print F "<tr><td>Packages</td>\n";
+print F "<td>" . join(" ",sort(keys(%secpkgs))) . " </td>";
+print F "<td>" . join(" ",sort(keys(%ownpkgs))) . " </td>";
+print F "<td>" . join(" ",sort(keys(%normpkgs))) . " </td></tr>\n";
+print F "</table>\n";
print F $table;