Fix removal of rendered files in rebuild mode.
authorJoey Hess <joey@kitenet.net>
Mon, 26 Apr 2010 21:14:03 +0000 (17:14 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 26 Apr 2010 21:14:03 +0000 (17:14 -0400)
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.

IkiWiki.pm
IkiWiki/Render.pm
debian/changelog

index 63a7f5e2a11517426db47e940827019f2d920198..944001d9b43fd64e436a5e23d6668fa79220f7ec 100644 (file)
@@ -1531,8 +1531,8 @@ sub loadindex () {
                my $d=$pages->{$src};
                my $page=pagename($src);
                $pagectime{$page}=$d->{ctime};
                my $d=$pages->{$src};
                my $page=pagename($src);
                $pagectime{$page}=$d->{ctime};
+               $pagesources{$page}=$src;
                if (! $config{rebuild}) {
                if (! $config{rebuild}) {
-                       $pagesources{$page}=$src;
                        $pagemtime{$page}=$d->{mtime};
                        $renderedfiles{$page}=$d->{dest};
                        if (exists $d->{links} && ref $d->{links}) {
                        $pagemtime{$page}=$d->{mtime};
                        $renderedfiles{$page}=$d->{dest};
                        if (exists $d->{links} && ref $d->{links}) {
index 871e005b2aca84026d09111c83fb228deff66f3b..b04664e41e5a9d0157ffedddca588c3738c322b1 100644 (file)
@@ -409,7 +409,7 @@ sub find_del_files ($) {
        my @del;
        my @internal_del;
 
        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};
                if (! $pages->{$page}) {
                        if (isinternal($page)) {
                                push @internal_del, $pagesources{$page};
index 53febb43362b7a8bbbae7f526d174c100f33803a..1229b119845e9c832c240b888da3657afd315515 100644 (file)
@@ -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.
   * 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
 
 
  -- Joey Hess <joeyh@debian.org>  Sun, 04 Apr 2010 12:17:11 -0400