Only unlink excess recentchanges from srcdir if not in transientdir
authorSimon McVittie <smcv@debian.org>
Sun, 26 Dec 2010 22:11:20 +0000 (22:11 +0000)
committerSimon McVittie <smcv@debian.org>
Fri, 7 Jan 2011 20:13:01 +0000 (20:13 +0000)
IkiWiki/Plugin/recentchanges.pm

index c3296d9e8a3d55ad8ab9fa4379f139b6f9091544..8ce9474be631dbd8ae428304e25d1d1d2adac3df 100644 (file)
@@ -58,8 +58,7 @@ sub refresh ($) {
        # delete old and excess changes
        foreach my $page (keys %pagesources) {
                if ($pagesources{$page} =~ /\._change$/ && ! $seen{$page}) {
        # delete old and excess changes
        foreach my $page (keys %pagesources) {
                if ($pagesources{$page} =~ /\._change$/ && ! $seen{$page}) {
-                       unlink($config{srcdir}.'/'.$pagesources{$page});
-                       unlink($IkiWiki::Plugin::transient::transientdir.'/'.$pagesources{$page});
+                       unlink($IkiWiki::Plugin::transient::transientdir.'/'.$pagesources{$page}) || unlink($config{srcdir}.'/'.$pagesources{$page});
                }
        }
 }
                }
        }
 }