}
}
+print "got " . scalar(keys(%restrpkgs)) . " restricted packages\n" if $debug;
if ( $debug >1 ) {
- print "got " . scalar(keys(%restrpkgs)) . " restricted packages\n";
for $pname ( sort (keys(%restrpkgs)) ) {
print " $pname " . $restrpkgs{$pname} . "\n";
}
my $normtot = 0;
my %updlinks;
+# Pending modification dates
+my %olddates; # Read in from the file
+my %newdates; # To be written in the new version of the file
+my $datefilename = "aptcheck.data";
+my $dateoldfilename = "aptcheck.old";
+my $thisdate = "*"; # indicates really old stuff
+if ( -f $datefilename ) {
+ print "Reading dates from $datefilename\n" if $debug;
+ open F, $datefilename or die "Could not open date file $datefilename: $!";
+ while (<F>) {
+ chop();
+ my ($pkg, $date) = split;
+ next unless $pkg; # skip empty lines
+ $olddates{$pkg} = $date;
+ print "Date for '$pkg' is '$date' \n" if $debug;
+ }
+ close F;
+ $thisdate = `date +%F`;
+ chomp($thisdate);
+} else {
+ print "No datefile $datefilename found, starting from scratch\n";
+}
+
+
my $table = "<table>\n";
for my $hline ( split("\n",$hostlist) ) {
$det .= "<td> $restrname <b>(M)</b></td>";
$det .= "<td>". strdiff($bver,$restrinst)."</td>";
$det .= "<td>". strdiff($restrinst,$bver)."</td>";
+ my $datekey = "$H:$restrname";
+ if ( $olddates{$datekey} ) {
+ $newdates{$datekey} = $olddates{$datekey};
+ } else {
+ $newdates{$datekey} = $thisdate;
+ }
+ $det .= "<td>" . $newdates{$datekey} . "</td>";
$det .= "</tr>\n";
my $key = "$restrname";
if ( !$summary{$key} ) {
$det .= "</td> ";
$det .= "<td>$cur</td> ";
$det .= "<td>$new</td> ";
+ my $datekey = "$H:$pkg";
+ if ( $olddates{$datekey} ) {
+ $newdates{$datekey} = $olddates{$datekey};
+ } else {
+ $newdates{$datekey} = $thisdate;
+ }
+ $det .= "<td>" . $newdates{$datekey} . "</td>";
$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 .= "</table>\n";
+# 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) ) {
+ print F "$k " . $newdates{$k}. "\n";
+ print "date for '$k' '" . $newdates{$k}. "'\n" if $debug;
+}
+close F
+ or die "Could not close date file $datefilename: $!";
+
# Page header
my $outfile = "/tmp/aptcheck.html";
open F, ">$outfile"
}
print F "</table>\n";
+print F "<p/>Packages marked with * are from the time before started to " .
+ "track package dates \n";
print F "<p/>Produced " . `date`.
" on " . `hostname` . " by " . `whoami` .
"<br/>\n";