From 91513466877df4329567f2cc73b6719999394258 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Jun 2009 19:31:18 -0400 Subject: aggregate: Avoid resetting ctime when an item md5 changes. Besides being wrong to do, this could lead to the wrong item being expired, as follows: If B is added and at the same time A is changed, then A's ctime may be set to the current time, while B's is set to its creation time. Thus the new item, A, is incorrectly removed as older. (This interacted especially badly with the bug fixed by 90b4d079605b72bb50d1da41402d994960e10937.) --- IkiWiki/Plugin/aggregate.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 60c292d52..5a9eb433d 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -650,11 +650,13 @@ sub add_page (@) { # creation time on record for the new page. utime $mtime, $mtime, "$config{srcdir}/".htmlfn($guid->{page}); # Store it in pagectime for expiry code to use also. - $IkiWiki::pagectime{$guid->{page}}=$mtime; + $IkiWiki::pagectime{$guid->{page}}=$mtime + unless exists $IkiWiki::pagectime{$guid->{page}}; } else { # Dummy value for expiry code. - $IkiWiki::pagectime{$guid->{page}}=time; + $IkiWiki::pagectime{$guid->{page}}=time + unless exists $IkiWiki::pagectime{$guid->{page}}; } } -- cgit v1.2.3