# 11-Mar-2011 Heikki: Started this
# 22-Mar-2011 Heikki: Adding manually maintained packages
# 15-Aug-2011 Heikki: Adding a total in the headline, for nagiosgrapher
+# 21-May-2012 Heikki: Added a date since when a package has been pending
+# 31-May-2012 Heikki: Pointing to the new wiki
#
# TODO: Assumes that we release our restricted packages for all versions
# and architectures at the same time. Gets only the highest version from
use strict;
my $debug= $ARGV[0] || 0; # 0=none, 1=some, 2=more, 3=much
my $year =`date +%Y`;
-my $wikilink = 'http://twiki.indexdata.dk/cgi-bin/twiki/view/ID/';
+#my $wikilink = 'http://twiki.indexdata.dk/cgi-bin/twiki/view/ID/';
+my $wikilink = 'https://twiki.indexdata.com/twiki/bin/view/ID/';
my $restrictedpackages = "ssh -q kebab cat /home/ftp/pub/debian/dists/*/restricted/*/Packages";
#### Host comments
print "found $pname, first version $pver\n" if $debug>1;
} else {
my $bver = $restrpkgs{$pname};
- `dpkg --compare-versions "$bver" lt "$pver" `;
+ `dpkg --compare-versions "$bver" lt "$pver" 2>/dev/null `;
if ( ! $? ) {
print "found $pname, better version $pver (better than $bver)\n"
if $debug>1;
my $mantot = 0;
my $normtot = 0;
my %updlinks;
+my %debversions;
# Pending modification dates
my %olddates; # Read in from the file
next if ($H =~ /^servicegroups/ );
print "Checking $H\n" if $debug;
$allhosts{$H}=1;
+ my $cmd0 = "cat /etc/debian_version";
my $cmd1 = "apt-cache -q policy " . join(" ",sort(keys(%restrpkgs)));
my $cmd2 = "apt-get upgrade -s -o 'Debug::NoLocking=true' ";
# Note, do not append -qq, we want some output even when nothing to do
- print "ssh -q $H \"$cmd1 ; $cmd2 \" 2>/dev/null" if ($debug>1);
- my $apt = `ssh -q $H "$cmd1 ; $cmd2 " 2>/dev/null`;
+ print "ssh -q $H \"$cmd0; $cmd1 ; $cmd2 \" 2>/dev/null \n" if ($debug>1);
+ my $apt = `ssh -q $H "$cmd0; $cmd1 ; $cmd2 " 2>/dev/null`;
if ( !$apt ) {
$table .= "<tr><td colspan='3'> </td></tr>\n";
$table .= "<tr><td colspan='3'><b><u>$H</u></b> (skipped)\n";
my $restrname = "";
my $restrinst = "";
my $restrcand = "";
+ my $debver = 0;
for my $p ( split("\n",$apt) ) {
+ if ( !$debver ) { # first line
+ $debver = 1;
+ $p =~ s/(5[0-9.]+)/$1 LENNY !!!/;
+ $p =~ s/(6[0-9.]+)/$1 squeeze/;
+ $p =~ s/(7[0-9.]+)/$1 wheezy/;
+ $p = " Debian $p";
+ $debversions{$H} = $p;
+ print "Deb version for $H is $p\n" if ($debug>1);
+ next;
+ }
# parse apt-cache output
$restrname = $1 if $p =~ /^(\S+):$/;
$restrinst = $1 if $p =~ /^\s+Installed:\s+(\S+)$/;
( $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" `;
+ `dpkg --compare-versions "$bver" lt "$restrinst" 2>/dev/null`;
if ( $? ) { # It was not a downgrade
# manual packages may be ahead of the repo!
$mantot++;
$det .= "</tr>\n";
}
- $table .= "<tr><td colspan='3'> </td></tr>\n";
- $table .= "<tr><td colspan='3'><a name='$H'><b><u>$H</u></b></a> \n";
+ $table .= "<tr><td colspan='4'> </td></tr>\n";
+ $table .= "<tr><td colspan='4'><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;
$updlink =~ s/Opencontent-solrUpdates/OpenContentSolrUpdates/;
$updlinks{$H} = $updlink;
$table .= " <a href='$updlink' >Upd</a>";
+ $table .= " " . $debversions{$H};
$table .= "</td></tr>\n";
$table .= "<tr><td>$hostcomments{$H}</td></tr>\n"
if ( $hostcomments{$H} );
# Save the date file
`mv -f $datefilename $dateoldfilename`;
open F, ">$datefilename" or die "Could not open date file $datefilename for writing";
-for my $k (keys(%newdates) ) {
+for my $k (sort(keys(%newdates)) ) {
print F "$k " . $newdates{$k}. "\n";
print "date for '$k' '" . $newdates{$k}. "'\n" if $debug;
}