X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=aptcheck%2Faptcheck.pl;h=71e00fe5c003f3594c7e420f9de5ece4f733c112;hb=2c2c89592cc515d7485732b89daa3c9e763c7c4c;hp=22ad13f339a6d835c00c81329e8fbf8ceeced9ca;hpb=d57c0508b74bf0b6bc7917ae3674d22376faebeb;p=git-tools-moved-to-github.git
diff --git a/aptcheck/aptcheck.pl b/aptcheck/aptcheck.pl
index 22ad13f..71e00fe 100755
--- a/aptcheck/aptcheck.pl
+++ b/aptcheck/aptcheck.pl
@@ -67,21 +67,19 @@ for $hline ( split("\n",$hostlist) ) {
$pkgs++;
my $key = $pkg;
if ( $src =~ /Security/ ) {
- $det .= "$pkg";
- $key = "$pkg";
+ $det .= "$pkg (s) ";
$sechosts{$H}=1;
$secpkgs{$pkg}=1;
$secs++;
$sectot++;
} elsif ( $src =~ /Indexdata/ ) {
- $det .= "$pkg";
- $key = "$pkg";
+ $det .= "$pkg (id) ";
$ownhosts{$H}=1;
$ownpkgs{$pkg}=1;
$own++;
$owntot++;
} else {
- $det .= "$pkg";
+ $det .= "$pkg ";
$normhosts{$H}=1;
$normpkgs{$pkg}=1;
$normtot++;
@@ -89,9 +87,9 @@ for $hline ( split("\n",$hostlist) ) {
if ( !$summary{$key} ) {
$summary{$key} = "";
}
+ $summary{$key} .= "$H ";
$new = strdiff($cur,$new);
$cur = strdiff($new,$cur);
- $summary{$key} .= "$H ";
$det .= " ";
$det .= "
$cur | ";
$det .= "$new | ";
@@ -126,7 +124,7 @@ print F "\n";
print F "Apt package status
\n";
-# Summary table - NEW: one row for per host group
+# Summary table: one row for per host group
print F "\n";
print F "\n";
print F " | " ;
@@ -140,7 +138,12 @@ if ( $sectot ) {
for $HH ( sort(keys(%sechosts)) ) {
print F "$HH ";
}
- print F "" . join(" ",sort(keys(%secpkgs))) . " | ";
+ print F "";
+ print F "";
+ for $PP ( sort(keys(%secpkgs)) ) {
+ print F "$PP ";
+ }
+ print F " | ";
print F "
\n";
}
if ( $owntot ) {
@@ -150,7 +153,13 @@ if ( $owntot ) {
for $HH ( sort(keys(%ownhosts)) ) {
print F "$HH ";
}
- print F "" . join(" ",sort(keys(%ownpkgs))) . " | ";
+ print F "";
+ print F "";
+ for $PP ( sort(keys(%ownpkgs)) ) {
+ print F "$PP ";
+ }
+ print F " | ";
+ #print F "" . join(" ",sort(keys(%ownpkgs))) . " | ";
print F "\n";
}
if ( $normtot ) {
@@ -185,6 +194,23 @@ print F "
\n";
# The host table
print F $table;
+# Package table
+print F "Packages\n";
+print F "\n";
+for $P ( sort(keys(%summary)) ) {
+ my $PN = $P;
+ $PN = "$P (s)" if ($secpkgs{$P});
+ $PN = "$P (id)" if ($ownpkgs{$P});
+ print F "$PN | \n";
+ print F "";
+ for $HH ( split(' ',$summary{$P} )) {
+ print F "$HH ";
+ }
+ print F " | \n";
+
+}
+print F "
\n";
+
print F "Produced " . `date`.
" on " . `hostname` . " by " . `whoami` .
"
\n";