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.
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
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 ($) {
my $tagfile = newpagefile(tagpage($tag), $config{default_pageext});
$tagfile=~s/^\///;
- return if (! add_autofile($tagfile));
+ return if (! add_autofile($tagfile, "tag"));
debug(sprintf(gettext("creating tag page %s"), $tag));
my ($changed, $internal_changed)=find_changed($files);
run_hooks(needsbuild => sub { shift->($changed) });
my $oldlink_targets=calculate_old_links($changed, $del);
+ %del_hash = map { $_ => 1 } @{$del};
foreach my $file (@$changed) {
scan($file);
}
- while (my $autofile = shift (@autofiles)) {
+ while (my $autofile = shift @{[keys %autofiles]}) {
+ my $plugin=$autofiles{$autofile};
my $page=pagename($autofile);
if ($pages->{$page}) {
debug(sprintf(gettext("%s has multiple possible source pages"), $page));
push @{$changed}, $autofile if find_changed([$autofile]);
scan($autofile);
+ delete $autofiles{$autofile};
}
calculate_links();