]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Detect plugins with a broken getsetup and warn.
authorJoey Hess <joey@kitenet.net>
Mon, 4 Mar 2013 17:19:05 +0000 (13:19 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 4 Mar 2013 17:19:05 +0000 (13:19 -0400)
IkiWiki/Setup.pm
debian/changelog

index 881e8a9d5960e9cad891b6b160de636bed03a3a9..453d19670d2bfc6113c2d87b3d0af44242823754 100644 (file)
@@ -172,6 +172,11 @@ sub getsetup () {
                        my @s=eval { $IkiWiki::hooks{getsetup}{$plugin}{call}->() };
                        next unless @s;
 
+                       if (scalar(@s) % 2 != 0) {
+                               print STDERR "warning: plugin $plugin has a broken getsetup; ignoring\n";
+                               next;
+                       }
+
                        # set default section value (note use of shared
                        # hashref between array and hash)
                        my %s=@s;
index 85acaf5304d10e1905cc056f3e4e70e49882484e..54e7c902406792acfbd39f7cfe1f35ab3621687e 100644 (file)
@@ -2,6 +2,7 @@ ikiwiki (3.20130213) UNRELEASED; urgency=low
 
   * Allow dots in directive parameter names. (tango)
   * Add missing plugin section, and deal with missing sections with a warning.
+  * Detect plugins with a broken getsetup and warn.
 
  -- Joey Hess <joeyh@debian.org>  Fri, 15 Feb 2013 17:23:12 -0400