}
}
+ my $file=$pagesources{$p};
+ my $type=pagetype($file);
if ($itemtemplate->query(name => "enclosure")) {
- my $file=$pagesources{$p};
- my $type=pagetype($file);
if (defined $type) {
$itemtemplate->param(content => $pcontent);
}
}
}
else {
+ next unless defined $type;
$itemtemplate->param(content => $pcontent);
}
if (! defined $code || ! defined $name ||
! length $code || ! length $name) {
# not a fatal error to avoid breaking if used with web setup
- print STDERR sprintf(gettext("%s has invalid syntax: must use CODE|NAME"),
- $pair)."\n";
+ warn sprintf(gettext("%s has invalid syntax: must use CODE|NAME"),
+ $pair);
}
return $code, $name;
my ($del, $internal_del)=find_del_files($pages);
my ($changed, $internal_changed)=find_changed($files);
run_hooks(needsbuild => sub {
- my $ret=shift->($changed);
+ my $ret=shift->($changed, [@$del, @$internal_del]);
$changed=$ret if ref $ret eq 'ARRAY';
});
my $oldlink_targets=calculate_old_links($changed, $del);
* po: Allow enabling via web setup.
* po: Auto-upgrade old format settings to new formats when writing
setup file.
+ * Pass array of names of files that have been deleted to needsbuild hook
+ as second parameter, to allow for plugins that needs access to this
+ information earlier than the delete hook.
-- Joey Hess <joeyh@debian.org> Tue, 07 Sep 2010 12:08:05 -0400
hook(type => "needsbuild", id => "foo", call => \&needsbuild);
-This allows a plugin to manipulate the list of files that need to be
-built when the wiki is refreshed. The function is passed a reference to an
-array of files that will be rebuilt. It should return an array reference
-that is a modified version of its input. It can add or remove files from it.
+This allows a plugin to observe or even manipulate the list of files that
+need to be built when the wiki is refreshed.
+
+As its first parameter, the function is passed a reference to an array of
+files that will be built. It should return an array reference that is a
+modified version of its input. It can add or remove files from it.
+
+The second parameter passed to the function is a reference to an array of
+files that have been deleted.
### scan