X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=aptcheck%2Faptcheck.pl;h=36646bb9656d87358232b5759894b767a20bac27;hb=46340c8a878d4a45eb3296c9a47f8d43110d7d78;hp=d49e41b4840730720be414f96051a82df03c686b;hpb=68b66ad9c0d64c8d0958b871db445b0b4c03d711;p=git-tools-moved-to-github.git diff --git a/aptcheck/aptcheck.pl b/aptcheck/aptcheck.pl index d49e41b..36646bb 100755 --- a/aptcheck/aptcheck.pl +++ b/aptcheck/aptcheck.pl @@ -27,9 +27,6 @@ # and architectures at the same time. Gets only the highest version from # all, and reports anything less than this. Good enough for now. # -# TODO: Get the dates from ls --full-time /var/cache/apt/archives/ -# and display next to the packages, so we can see how long they have -# been lingering. Boldface them if older than some limit #### Init use strict; @@ -129,6 +126,8 @@ 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 +my $warndate; # Older than this will be boldfaced + if ( -f $datefilename ) { print "Reading dates from $datefilename\n" if $debug; open F, $datefilename or die "Could not open date file $datefilename: $!"; @@ -142,6 +141,9 @@ if ( -f $datefilename ) { close F; $thisdate = `date +%F`; chomp($thisdate); + $warndate = `date +%F -d "30 days ago"` ; ; + chomp($warndate); + print "Dates: now: '$thisdate' warn: '$warndate'\n" if $debug; } else { print "No datefile $datefilename found, starting from scratch\n"; } @@ -218,7 +220,12 @@ for my $hline ( sort( split("\n",$hostlist) ) ) { } else { $newdates{$datekey} = $thisdate; } - $det .= "