$H (skipped)\n"; @@ -52,11 +158,56 @@ for $hline ( split("\n",$hostlist) ) { next; } print "Got apts for $H: \n$apt\n" if $debug>2; - my $det = ""; + my $det = ""; # detail lines my $pkgs = 0; my $secs = 0; my $own = 0; - for $p ( split("\n",$apt) ) { + my $man = 0; + my $restrname = ""; + my $restrinst = ""; + my $restrcand = ""; + for my $p ( split("\n",$apt) ) { + # parse apt-cache output + $restrname = $1 if $p =~ /^(\S+):$/; + $restrinst = $1 if $p =~ /^\s+Installed:\s+(\S+)$/; + $restrcand = $1 if $p =~ /^\s+Candidate:\s+(\S+)$/; + if ( $p =~ /^\s+Version table:/ ) { # have all for that package + my $bver = $restrpkgs{$restrname}; + if ( ( $restrinst eq $restrcand ) && + ( $restrinst ne $bver ) ) { + # if different, it is a regular apt upgrade, and will be seen + # later. AND we want to have a different version in our repo + `dpkg --compare-versions "$bver" lt "$restrinst" `; + if ( $? ) { # It was not a downgrade + # manual packages may be ahead of the repo! + $mantot++; + $man++; + $pkgs++; + $manhosts{$H} = 1; + $manpkgs{$restrname} = 1; + $det .= " | |||
$restrname (M) | "; + $det .= "". strdiff($bver,$restrinst)." | "; + $det .= "". strdiff($restrinst,$bver)." | "; + my $datekey = "$H:$restrname"; + if ( $olddates{$datekey} ) { + $newdates{$datekey} = $olddates{$datekey}; + } else { + $newdates{$datekey} = $thisdate; + } + $det .= "" . $newdates{$datekey} . " | "; + $det .= "$cur | "; $det .= "$new | "; + my $datekey = "$H:$pkg"; + if ( $olddates{$datekey} ) { + $newdates{$datekey} = $olddates{$datekey}; + } else { + $newdates{$datekey} = $thisdate; + } + $det .= "" . $newdates{$datekey} . " | "; $det .= "\n"; + } $table .= "
$H \n"; if ( $pkgs ) { $table .= "$pkgs packages to upgrade. "; $table .= "$secs security. " if $secs; - $table .= " $own from indexdata " if $own; + $table .= " $own from indexdata. " if $own; + $table .= " $man manual. " if $man; } else { $table .= "ok"; + $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/; + $updlinks{$H} = $updlink; $table .= " Upd"; $table .= " | |||
$hostcomments{$H} |
" ; -print F " | Security: " . scalar(keys(%sechosts)) . - " / " . scalar(keys(%secpkgs)) . " / $sectot | \n" ; -print F "Indexdata: " . scalar(keys(%ownhosts)) . - " / " . scalar(keys(%ownpkgs)) . " / $owntot | \n" ; -print F "Normal: " . scalar(keys(%normhosts)) . - " / " . scalar(keys(%normpkgs)) . " / $normtot | " . "
Hosts | \n"; - - -print F ""; -for $HH ( sort(keys(%sechosts)) ) { - print F "$HH "; +print F " | Hosts | \n"; +print F "Packages |
Security " . scalar(keys(%sechosts)) . + " / " . scalar(keys(%secpkgs)) . " / $sectot | \n" ;
+ print F ""; + for my $HH ( sort(keys(%sechosts)) ) { + my $upd = $updlinks{$HH} || "#" ; + print F "$HH, "; + } + print F " | "; + print F ""; + for my $PP ( sort(keys(%secpkgs)) ) { + print F "$PP "; + } + print F " | "; + print F "" . join(" ",sort(keys(%sechosts))) . " | "; -#print F "" . join(" ",sort(keys(%ownhosts))) . " | "; -print F ""; -for $HH ( sort(keys(%ownhosts)) ) { - print F "$HH "; +if ( $owntot ) { + print F " |
Indexdata " . scalar(keys(%ownhosts)) . + " / " . scalar(keys(%ownpkgs)) . " / $owntot | \n" ;
+ print F ""; + for my $HH ( sort(keys(%ownhosts)) ) { + my $upd = $updlinks{$HH} || "#" ; + print F "$HH, "; + #print F "$HH "; + } + print F " | "; + print F ""; + for my $PP ( sort(keys(%ownpkgs)) ) { + print F "$PP "; + } + print F " | "; + print F "" . join(" ",sort(keys(%normhosts))) . " | \n"; -print F ""; -for $HH ( sort(keys(%normhosts)) ) { - print F "$HH "; +if ( $mantot ) { + print F " |
Manual " . scalar(keys(%manhosts)) . + " / " . scalar(keys(%manpkgs)) . " / $mantot | \n" ;
+ print F ""; + for my $HH ( sort(keys(%manhosts)) ) { + my $upd = $updlinks{$HH} || "#" ; + print F "$HH, "; + #print F "$HH "; + } + print F " | "; + print F ""; + for my $PP ( sort(keys(%manpkgs)) ) { + print F "$PP "; + } + print F " | "; + print F "|
Normal " . scalar(keys(%normhosts)) . + " / " . scalar(keys(%normpkgs)) . " / $normtot | \n" ;
+ print F ""; + for my $HH ( sort(keys(%normhosts)) ) { + my $upd = $updlinks{$HH} || "#" ; + print F "$HH, "; + #print F "$HH "; + } + print F " | "; + print F ""; + for my $PP ( sort(keys(%normpkgs)) ) { + print F "$PP "; + } + print F " | "; + print F "|
Skipped " . scalar(keys(%skiphosts)) . " | \n"; + print F ""; + for my $HH ( sort(keys(%skiphosts)) ) { + my $upd = $updlinks{$HH} || + $wikilink . ucfirst($HH) . "Updates" . $year; + print F "$HH, "; + #print F "$HH "; + } + print F " | ||
Ok " . scalar(keys(%okhosts)) . " | \n"; + print F ""; + for my $HH ( sort(keys(%okhosts)) ) { + my $upd = $updlinks{$HH} || "#" ; + print F "$HH, "; + #print F "$HH "; + } + if ( !%okhosts ) { + print F "None at all!"; + } + print F " | ||
Packages | \n"; -print F "" . join(" ",sort(keys(%secpkgs))) . " | "; -print F "" . join(" ",sort(keys(%ownpkgs))) . " | "; -print F "" . join(" ",sort(keys(%normpkgs))) . " |
$PN | \n"; + print F ""; + for my $HH ( split(' ',$summary{$P} )) { + print F "$HH "; + } + print F " | \n"; + +} +print F "