From: Joey Hess Date: Mon, 26 Apr 2010 21:14:03 +0000 (-0400) Subject: Fix removal of rendered files in rebuild mode. X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/97b0c6e455f9edb99d9bd5145a8e82549ed54694 Fix removal of rendered files in rebuild mode. Needed to handle the move of the .js files into ikiwiki/, but also this is a longstanding bug. Old pagemtime is not remembered in rebuild mode, and changing that would need a lot of changes. So instead, loop on pagectime, which is remembered. Change to remembering old pagesources info in rebuild mode. This seems safe enough. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 63a7f5e2a..944001d9b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1531,8 +1531,8 @@ sub loadindex () { my $d=$pages->{$src}; my $page=pagename($src); $pagectime{$page}=$d->{ctime}; + $pagesources{$page}=$src; if (! $config{rebuild}) { - $pagesources{$page}=$src; $pagemtime{$page}=$d->{mtime}; $renderedfiles{$page}=$d->{dest}; if (exists $d->{links} && ref $d->{links}) { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 871e005b2..b04664e41 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -409,7 +409,7 @@ sub find_del_files ($) { my @del; my @internal_del; - foreach my $page (keys %pagemtime) { + foreach my $page (keys %pagectime) { if (! $pages->{$page}) { if (isinternal($page)) { push @internal_del, $pagesources{$page}; diff --git a/debian/changelog b/debian/changelog index 53febb433..1229b1198 100644 --- a/debian/changelog +++ b/debian/changelog @@ -74,6 +74,7 @@ ikiwiki (3.20100424) UNRELEASED; urgency=low * Moved javascript files under the ikiwiki/ directory, to avoid cluttering the top of the web root. This is another things that requires a wiki rebuild on upgrade to this version. + * Fix removal of rendered files in rebuild mode. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400