aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-04-26 17:14:03 -0400
committerJoey Hess <joey@kitenet.net>2010-04-26 17:14:03 -0400
commit97b0c6e455f9edb99d9bd5145a8e82549ed54694 (patch)
tree19a12204cdf1c6604f9cbab64f98af6a60be2849
parenta6bd053638c67e5410c4a0a3742ba3825320b344 (diff)
downloadikiwiki-97b0c6e455f9edb99d9bd5145a8e82549ed54694.tar
ikiwiki-97b0c6e455f9edb99d9bd5145a8e82549ed54694.tar.gz
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.
-rw-r--r--IkiWiki.pm2
-rw-r--r--IkiWiki/Render.pm2
-rw-r--r--debian/changelog1
3 files changed, 3 insertions, 2 deletions
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 <joeyh@debian.org> Sun, 04 Apr 2010 12:17:11 -0400