]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Pass array of names of files that have been deleted to needsbuild hook as second...
authorJoey Hess <joey@kitenet.net>
Fri, 10 Sep 2010 21:17:08 +0000 (17:17 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 10 Sep 2010 21:17:08 +0000 (17:17 -0400)
IkiWiki/Plugin/inline.pm
IkiWiki/Render.pm
debian/changelog
doc/plugins/write.mdwn

index 715a3d6523cfcee4e57c125425d19cfdab110298..20c5f3bddc08473bd06f27dfa5f5c3e35e1b22c0 100644 (file)
@@ -570,9 +570,9 @@ sub genfeed ($$$$$@) {
                        }
                }
 
+               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);
                        }
@@ -591,6 +591,7 @@ sub genfeed ($$$$$@) {
                        }
                }
                else {
+                       next unless defined $type;
                        $itemtemplate->param(content => $pcontent);
                }
 
index 0dbe9611af72f31a1fcc6084049375fae8286d59..7ea919abc3d76c2b9fc280c81ed4f87cbb95d8cb 100644 (file)
@@ -760,7 +760,7 @@ sub refresh () {
        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);
index 4b61a12b01bb227343e303af629d78a51fa7e7c8..bf294b6d460ea63c71cf5f594c9646cfa3ff950d 100644 (file)
@@ -12,6 +12,9 @@ ikiwiki (3.20100832) UNRELEASED; urgency=low
   * 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
 
index 31bb64e68a258eccf046e0900f36fecd15c66034..e60314485e77409e124330345f436b4895d37e51 100644 (file)
@@ -177,10 +177,15 @@ function is passed no values.
 
        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