X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=aptcheck%2Faptcheck.pl;h=ad72adba15804d9c2ed17e16e78a1f68b0e23bb7;hb=fe107795d8c5c5dd4df63dee5c7aa9ba81d13a45;hp=317341d331b0a67c8139624eed369d3b683bb31a;hpb=ed217e789ded5e656e7d479ecafdc232ccfaca97;p=git-tools-moved-to-github.git diff --git a/aptcheck/aptcheck.pl b/aptcheck/aptcheck.pl index 317341d..ad72adb 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 (s) "; - $key = "$pkg"; + $det .= "$pkg (s) "; $sechosts{$H}=1; $secpkgs{$pkg}=1; $secs++; $sectot++; } elsif ( $src =~ /Indexdata/ ) { $det .= "$pkg (id) "; - $key = "$pkg"; $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 "; @@ -108,6 +106,10 @@ for $hline ( split("\n",$hostlist) ) { $okhosts{$H} = 1; } my $updlink = $wikilink . ucfirst($H) . "Updates" . $year; + # Fix some pages that do not follow the convention. + # Mostly because the host names would not make proper WikiWords + $updlink =~ s/Bugzilla3Updates/BugzillaUpdates/; + $updlink =~ s/Opencontent-solrUpdates/OpenContentSolrUpdates/; $table .= " Upd"; $table .= "\n"; $table .= $det if $pkgs; @@ -126,7 +128,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 "" ; @@ -135,36 +137,51 @@ print F "\n"; if ( $sectot ) { print F "\n" ; + " / " . scalar(keys(%secpkgs)) . " / $sectot \n" ; print F ""; + print F ""; + print F ""; print F "\n"; } if ( $owntot ) { print F "\n" ; + " / " . scalar(keys(%ownpkgs)) . " / $owntot \n" ; print F ""; + print F ""; + print F ""; print F "\n"; } if ( $normtot ) { - print F "\n" ; + print F "\n" ; print F ""; + print F ""; + print F ""; print F "\n"; } if ( %skiphosts ) { - print F "\n"; + print F "\n"; print F "\n"; } if ( %okhosts ) { - print F "\n"; + print F "\n"; print F "
 Packages
Security
" . scalar(keys(%sechosts)) . - " / " . scalar(keys(%secpkgs)) . " / $sectot
"; for $HH ( sort(keys(%sechosts)) ) { print F "$HH "; } - print F "" . join(" ",sort(keys(%secpkgs))) . " "; + for $PP ( sort(keys(%secpkgs)) ) { + print F "$PP "; + } + print F "
Indexdata
" . scalar(keys(%ownhosts)) . - " / " . scalar(keys(%ownpkgs)) . " / $owntot
"; for $HH ( sort(keys(%ownhosts)) ) { print F "$HH "; } - print F "" . join(" ",sort(keys(%ownpkgs))) . " "; + for $PP ( sort(keys(%ownpkgs)) ) { + print F "$PP "; + } + print F "
Indexdata
" . scalar(keys(%normhosts)) . - " / " . scalar(keys(%normpkgs)) . " / $normtot
Normal
" . scalar(keys(%normhosts)) . + " / " . scalar(keys(%normpkgs)) . " / $normtot
"; for $HH ( sort(keys(%normhosts)) ) { print F "$HH "; } - print F "" . join(" ",sort(keys(%normpkgs))) . " "; + for $PP ( sort(keys(%normpkgs)) ) { + print F "$PP "; + } + print F "
Skipped: " . scalar(keys(%skiphosts)) . "
Skipped " . scalar(keys(%skiphosts)) . ""; for $HH ( sort(keys(%skiphosts)) ) { print F "$HH "; @@ -172,7 +189,7 @@ if ( %skiphosts ) { print F "
Ok: " . scalar(keys(%okhosts)) . "
Ok " . scalar(keys(%okhosts)) . ""; for $HH ( sort(keys(%okhosts)) ) { print F "$HH "; @@ -185,6 +202,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 "\n"; + print F "\n"; + +} +print F "
$PN"; + for $HH ( split(' ',$summary{$P} )) { + print F "$HH "; + } + print F "
\n"; + print F "

Produced " . `date`. " on " . `hostname` . " by " . `whoami` . "
\n"; @@ -203,13 +237,16 @@ sub strdiff { my $x = shift; my $y = shift; print "strdiff: '$x' '$y' \n" if $debug>1; + if ( $x eq $y ) { + return "$x ??"; + } my $a = 0; while ( $a < length($y) && substr($x,$a,1) eq substr($y,$a,1) ) { $a++; } if ( $a == length($y) ) { - return "$y ???"; + return "$y ??"; } my $b = 1; while ( $b < length($y)-$a &&