diff options
author | David Riebenbauer <davrieb@liegesta.at> | 2010-04-03 21:10:16 +0200 |
---|---|---|
committer | David Riebenbauer <davrieb@liegesta.at> | 2010-04-03 22:20:48 +0200 |
commit | 981400177d68a279f485727be3f013e68f0bf691 (patch) | |
tree | 228443b89edb0da20fe739c54d6b45aae5585863 /IkiWiki.pm | |
parent | 628a52a6c49f5d2fc5af251f2d718c8dff5e8ed5 (diff) | |
download | ikiwiki-981400177d68a279f485727be3f013e68f0bf691.tar ikiwiki-981400177d68a279f485727be3f013e68f0bf691.tar.gz |
Make sure deleted tag pages don't get recreated.
The reason to do this is basically a user interaction design decision.
It is achieved by adding an entry, associated to the creating plugin, to
%pagestate. To find out if files were deleted a new global hash %del_hash is
%introduced.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 1770703a5..966a3bbc6 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -14,7 +14,7 @@ use open qw{:utf8 :std}; use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %pagestate %wikistate %renderedfiles %oldrenderedfiles %pagesources %destsources %depends %depends_simple %hooks - %forcerebuild %loaded_plugins @autofiles}; + %forcerebuild %loaded_plugins %autofiles %del_hash}; use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage deptype @@ -1895,17 +1895,28 @@ sub add_link ($$) { unless grep { $_ eq $link } @{$links{$page}}; } -sub add_autofile ($) { +sub add_autofile ($$) { my $autofile=shift; + my $plugin=shift; if (srcfile($autofile, 1)) { return 0; } my ($file, $page) = verify_src_file("$config{srcdir}/$autofile", $config{srcdir}); - if (defined $file) { - push @autofiles, $file; + + if ((!defined $file) || + (exists $pagestate{$page}{$plugin}{autofile_deleted})) { + return 0; + } + + if (exists $del_hash{$file}) { + $pagestate{$page}{$plugin}{autofile_deleted}=1; + return 0; } + + $autofiles{$file}=$plugin; + return 1; } sub pagespec_translate ($) { |