diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-09-25 15:38:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-09-25 15:38:51 -0400 |
commit | 093e8154408d9a7517a0df1768f44ad581c70be2 (patch) | |
tree | b0ceb72d2738d49e9cecccb57f6dfd223ba09f17 | |
parent | 4c6d359b5fbe8f746965a2646a7bea03284b23cc (diff) | |
download | ikiwiki-093e8154408d9a7517a0df1768f44ad581c70be2.tar ikiwiki-093e8154408d9a7517a0df1768f44ad581c70be2.tar.gz |
aggregate: Avoid uninitialized value warnings for pages with no recorded ctime.
I saw this in the wild, apparently a page was not present on disk, but was
in the aggregate db, and not marked as expired either. Not sure how that
happened, but such pages should get marked as expired since they have an
effectively zero ctime.
-rw-r--r-- | IkiWiki/Plugin/aggregate.pm | 4 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 2b40625db..07c557bcd 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -420,11 +420,11 @@ sub expire () { #{{{ next unless $feed->{expireage} || $feed->{expirecount}; my $count=0; my %seen; - foreach my $item (sort { $IkiWiki::pagectime{$b->{page}} <=> $IkiWiki::pagectime{$a->{page}} } + foreach my $item (sort { ($IkiWiki::pagectime{$b->{page}} || 0) <=> ($IkiWiki::pagectime{$a->{page}} || 0) } grep { exists $_->{page} && $_->{feed} eq $feed->{name} } values %guids) { if ($feed->{expireage}) { - my $days_old = (time - $IkiWiki::pagectime{$item->{page}}) / 60 / 60 / 24; + my $days_old = (time - ($IkiWiki::pagectime{$item->{page}} || 0) / 60 / 60 / 24; if ($days_old > $feed->{expireage}) { debug(sprintf(gettext("expiring %s (%s days old)"), $item->{page}, int($days_old))); diff --git a/debian/changelog b/debian/changelog index f3f30dc21..ff119a314 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ikiwiki (2.66) UNRELEASED; urgency=low * recentchanges: Fix redirects to non-page files. + * aggregate: Avoid uninitialized value warnings for pages with no recorded + ctime. -- Joey Hess <joeyh@debian.org> Thu, 25 Sep 2008 13:45:55 -0400 |