Group related plugins into sections in the setup file, and drop unused rcs plugins from the setup file.
parent
c923e0ba33
commit
a63929f6cc
|
@ -15,6 +15,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
anonok_pagespec => {
|
anonok_pagespec => {
|
||||||
type => "pagespec",
|
type => "pagespec",
|
||||||
|
|
|
@ -18,6 +18,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
blogspam_pagespec => {
|
blogspam_pagespec => {
|
||||||
type => 'pagespec',
|
type => 'pagespec',
|
||||||
|
|
|
@ -36,6 +36,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
bzr_wrapper => {
|
bzr_wrapper => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -16,6 +16,7 @@ sub getsetup {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
cvsrepo => {
|
cvsrepo => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -92,6 +92,7 @@ sub getsetup() {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
darcs_wrapper => {
|
darcs_wrapper => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -17,6 +17,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 1,
|
rebuild => 1,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
git_wrapper => {
|
git_wrapper => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -40,6 +40,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
htmlscrubber_skip => {
|
htmlscrubber_skip => {
|
||||||
type => "pagespec",
|
type => "pagespec",
|
||||||
|
|
|
@ -20,6 +20,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
cgiauthurl => {
|
cgiauthurl => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -49,6 +49,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
rss => {
|
rss => {
|
||||||
type => "boolean",
|
type => "boolean",
|
||||||
|
|
|
@ -20,6 +20,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 1,
|
rebuild => 1,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
locked_pages => {
|
locked_pages => {
|
||||||
type => "pagespec",
|
type => "pagespec",
|
||||||
|
|
|
@ -16,6 +16,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 1, # format plugin
|
rebuild => 1, # format plugin
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
multimarkdown => {
|
multimarkdown => {
|
||||||
type => "boolean",
|
type => "boolean",
|
||||||
|
|
|
@ -36,6 +36,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
mercurial_wrapper => {
|
mercurial_wrapper => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -20,6 +20,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
moderate_users => {
|
moderate_users => {
|
||||||
type => 'boolean',
|
type => 'boolean',
|
||||||
|
|
|
@ -68,6 +68,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
mtn_wrapper => {
|
mtn_wrapper => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -16,6 +16,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
openidsignup => {
|
openidsignup => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -16,6 +16,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 1,
|
rebuild => 1,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
account_creation_password => {
|
account_creation_password => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -22,6 +22,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 1,
|
rebuild => 1,
|
||||||
|
section => "core",
|
||||||
},
|
},
|
||||||
recentchangespage => {
|
recentchangespage => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -16,6 +16,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
|
section => "auth",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
svnrepo => {
|
svnrepo => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -34,6 +34,7 @@ sub getsetup () {
|
||||||
plugin => {
|
plugin => {
|
||||||
safe => 0, # rcs plugin
|
safe => 0, # rcs plugin
|
||||||
rebuild => undef,
|
rebuild => undef,
|
||||||
|
section => "rcs",
|
||||||
},
|
},
|
||||||
tla_wrapper => {
|
tla_wrapper => {
|
||||||
type => "string",
|
type => "string",
|
||||||
|
|
|
@ -77,7 +77,6 @@ sub merge ($) {
|
||||||
sub getsetup () {
|
sub getsetup () {
|
||||||
# Gets all available setup data from all plugins. Returns an
|
# Gets all available setup data from all plugins. Returns an
|
||||||
# ordered list of [plugin, setup] pairs.
|
# ordered list of [plugin, setup] pairs.
|
||||||
my @ret;
|
|
||||||
|
|
||||||
# disable logging to syslog while dumping, broken plugins may
|
# disable logging to syslog while dumping, broken plugins may
|
||||||
# whine when loaded
|
# whine when loaded
|
||||||
|
@ -85,27 +84,48 @@ sub getsetup () {
|
||||||
$config{syslog}=undef;
|
$config{syslog}=undef;
|
||||||
|
|
||||||
# Load all plugins, so that all setup options are available.
|
# Load all plugins, so that all setup options are available.
|
||||||
my @plugins=grep { $_ ne $config{rcs} } sort(IkiWiki::listplugins());
|
my @plugins=IkiWiki::listplugins();
|
||||||
unshift @plugins, $config{rcs} if $config{rcs}; # rcs plugin 1st
|
|
||||||
foreach my $plugin (@plugins) {
|
foreach my $plugin (@plugins) {
|
||||||
eval { IkiWiki::loadplugin($plugin) };
|
eval { IkiWiki::loadplugin($plugin) };
|
||||||
if (exists $IkiWiki::hooks{checkconfig}{$plugin}{call}) {
|
if (exists $IkiWiki::hooks{checkconfig}{$plugin}{call}) {
|
||||||
my @s=eval { $IkiWiki::hooks{checkconfig}{$plugin}{call}->() };
|
my @s=eval { $IkiWiki::hooks{checkconfig}{$plugin}{call}->() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my %sections;
|
||||||
foreach my $plugin (@plugins) {
|
foreach my $plugin (@plugins) {
|
||||||
if (exists $IkiWiki::hooks{getsetup}{$plugin}{call}) {
|
if (exists $IkiWiki::hooks{getsetup}{$plugin}{call}) {
|
||||||
# use an array rather than a hash, to preserve order
|
# use an array rather than a hash, to preserve order
|
||||||
my @s=eval { $IkiWiki::hooks{getsetup}{$plugin}{call}->() };
|
my @s=eval { $IkiWiki::hooks{getsetup}{$plugin}{call}->() };
|
||||||
next unless @s;
|
next unless @s;
|
||||||
push @ret, [ $plugin, \@s ],
|
|
||||||
|
# set default section value (note use of shared
|
||||||
|
# hashref between array and hash)
|
||||||
|
my %s=@s;
|
||||||
|
if (! exists $s{plugin} || ! $s{plugin}->{section}) {
|
||||||
|
$s{plugin}->{section}="misc";
|
||||||
|
}
|
||||||
|
|
||||||
|
# only the selected rcs plugin is included
|
||||||
|
if ($config{rcs} && $plugin eq $config{rcs}) {
|
||||||
|
$s{plugin}->{section}="core";
|
||||||
|
}
|
||||||
|
elsif ($s{plugin}->{section} eq "rcs") {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
push @{$sections{$s{plugin}->{section}}}, [ $plugin, \@s ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$config{syslog}=$syslog;
|
$config{syslog}=$syslog;
|
||||||
|
|
||||||
return @ret;
|
return map { sort { $a->[0] cmp $b->[0] } @{$sections{$_}} }
|
||||||
|
sort { # core first, then alphabetical
|
||||||
|
($b eq "core") <=> ($a eq "core")
|
||||||
|
||
|
||||||
|
$a cmp $b
|
||||||
|
} keys %sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub dump ($) {
|
sub dump ($) {
|
||||||
|
|
|
@ -90,10 +90,18 @@ sub gendump ($) {
|
||||||
# disable logging to syslog while dumping
|
# disable logging to syslog while dumping
|
||||||
$config{syslog}=undef;
|
$config{syslog}=undef;
|
||||||
|
|
||||||
|
my $curr_section;
|
||||||
push @ret, dumpvalues(\%setup, IkiWiki::getsetup());
|
push @ret, dumpvalues(\%setup, IkiWiki::getsetup());
|
||||||
foreach my $pair (IkiWiki::Setup::getsetup()) {
|
foreach my $pair (IkiWiki::Setup::getsetup()) {
|
||||||
my $plugin=$pair->[0];
|
my $plugin=$pair->[0];
|
||||||
my $setup=$pair->[1];
|
my $setup=$pair->[1];
|
||||||
|
my %s=@{$setup};
|
||||||
|
my $section=$s{plugin}->{section};
|
||||||
|
if (! defined $curr_section || $curr_section ne $section) {
|
||||||
|
$curr_section=$section;
|
||||||
|
push @ret, "", "\t#", "\t# $section plugins", "\t#";
|
||||||
|
}
|
||||||
|
|
||||||
my @values=dumpvalues(\%setup, @{$setup});
|
my @values=dumpvalues(\%setup, @{$setup});
|
||||||
if (@values) {
|
if (@values) {
|
||||||
push @ret, "", "\t# $plugin plugin", @values;
|
push @ret, "", "\t# $plugin plugin", @values;
|
||||||
|
|
|
@ -22,6 +22,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low
|
||||||
* httpauth: Add httpauth_pagespec setting that can be used to limit
|
* httpauth: Add httpauth_pagespec setting that can be used to limit
|
||||||
pages to only being edited via users authed with httpauth.
|
pages to only being edited via users authed with httpauth.
|
||||||
* Allow globs to be used in user() pagespecs.
|
* Allow globs to be used in user() pagespecs.
|
||||||
|
* Group related plugins into sections in the setup file, and drop
|
||||||
|
unused rcs plugins from the setup file.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Tue, 26 Jan 2010 22:25:33 -0500
|
-- Joey Hess <joeyh@debian.org> Tue, 26 Jan 2010 22:25:33 -0500
|
||||||
|
|
||||||
|
|
|
@ -457,6 +457,12 @@ describing the option. There can also be an item named "plugin", which
|
||||||
describes the plugin as a whole. For example:
|
describes the plugin as a whole. For example:
|
||||||
|
|
||||||
return
|
return
|
||||||
|
plugin => {
|
||||||
|
description => "description of this plugin",
|
||||||
|
safe => 1,
|
||||||
|
rebuild => 1,
|
||||||
|
section => "misc",
|
||||||
|
},
|
||||||
option_foo => {
|
option_foo => {
|
||||||
type => "boolean",
|
type => "boolean",
|
||||||
description => "enable foo?",
|
description => "enable foo?",
|
||||||
|
@ -471,11 +477,6 @@ describes the plugin as a whole. For example:
|
||||||
safe => 1,
|
safe => 1,
|
||||||
rebuild => 0,
|
rebuild => 0,
|
||||||
},
|
},
|
||||||
plugin => {
|
|
||||||
description => "description of this plugin",
|
|
||||||
safe => 1,
|
|
||||||
rebuild => 1,
|
|
||||||
},
|
|
||||||
|
|
||||||
* `type` can be "boolean", "string", "integer", "pagespec",
|
* `type` can be "boolean", "string", "integer", "pagespec",
|
||||||
or "internal" (used for values that are not user-visible). The type is
|
or "internal" (used for values that are not user-visible). The type is
|
||||||
|
@ -496,6 +497,8 @@ describes the plugin as a whole. For example:
|
||||||
the plugin) will require a wiki rebuild, false if no rebuild is needed,
|
the plugin) will require a wiki rebuild, false if no rebuild is needed,
|
||||||
and undef if a rebuild could be needed in some circumstances, but is not
|
and undef if a rebuild could be needed in some circumstances, but is not
|
||||||
strictly required.
|
strictly required.
|
||||||
|
* `section` can optionally specify which section in the config file
|
||||||
|
the plugin fits in.
|
||||||
|
|
||||||
### genwrapper
|
### genwrapper
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue