]> sipb.mit.edu Git - ikiwiki.git/commitdiff
remember autofiles always
authorJoey Hess <joey@kitenet.net>
Wed, 21 Apr 2010 19:59:39 +0000 (15:59 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 21 Apr 2010 19:59:39 +0000 (15:59 -0400)
This fixes the problem that it did not remember if an autofile is deleted,
unless a plugin happened to register the autofile at the same time.

With the new code, we just never recreate an autofile more than once.

Only downside is that the list of autofiles is never pruned either.
And I don't really see a way to prune it.

IkiWiki/Render.pm

index 09c9121f36d41aa3924d7f2bb86a0b51b21a2762..b3afabf32fad0c6362227776f201b3aeefd955f9 100644 (file)
@@ -692,7 +692,7 @@ sub gen_autofile ($$$) {
        }
 
        if ((!defined $file) ||
        }
 
        if ((!defined $file) ||
-           (exists $wikistate{$autofiles{$autofile}{plugin}}{deleted_autofile}{$autofile})) {
+           (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile})) {
                return;
        }
        
                return;
        }
        
@@ -702,11 +702,11 @@ sub gen_autofile ($$$) {
        }
 
        if (grep { $_ eq $autofile } @$del) {
        }
 
        if (grep { $_ eq $autofile } @$del) {
-               $wikistate{$autofiles{$autofile}{plugin}}{deleted_autofile}{$autofile}=1;
                return;
        }
 
        $autofiles{$autofile}{generator}->();
                return;
        }
 
        $autofiles{$autofile}{generator}->();
+       $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}=1;
        $pages->{$page}=1;
        return 1;
 }
        $pages->{$page}=1;
        return 1;
 }