more symetric enable/disable
authorJoey Hess <joey@kitenet.net>
Sun, 13 Jun 2010 14:23:05 +0000 (10:23 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 13 Jun 2010 14:25:17 +0000 (10:25 -0400)
Removing a plugin from add_plugins is not always enough to disable it.
It may have been redundantly added there and also pulled in via goodstuff.
Always add didabled plugins to disable_plugins.

IkiWiki/Plugin/websetup.pm

index c4b75c4b3c98988938bcdd989109513babecba2d..11b4428e3fc0a55f6637516c56b2dca8a7460163 100644 (file)
@@ -253,12 +253,8 @@ sub enable_plugin ($) {
 sub disable_plugin ($) {
        my $plugin=shift;
 
-       if (grep { $_ eq $plugin } @{$config{add_plugins}}) {
-               $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}];
-       }
-       else {
-               push @{$config{disable_plugins}}, $plugin;
-       }
+       $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}];
+       push @{$config{disable_plugins}}, $plugin;
 }
 
 sub showform ($$) {