X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/adc2eb3d8c900a011000431b01ff4b89d5f4f689..11fc28970b329334d88d3667e5b55e0d57e353ab:/IkiWiki/Setup.pm diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index f8bb664c4..8a25ecc57 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -10,7 +10,7 @@ use IkiWiki; use open qw{:utf8 :std}; use File::Spec; -sub load ($) { # {{{ +sub load ($) { my $setup=IkiWiki::possibly_foolish_untaint(shift); $config{setupfile}=File::Spec->rel2abs($setup); @@ -20,20 +20,21 @@ sub load ($) { # {{{ my $code; { local $/=undef; - $code=; + $code= || error("$setup: $!"); } + ($code)=$code=~/(.*)/s; close IN; eval $code; error("$setup: ".$@) if $@; -} #}}} +} sub merge ($) { # Merge setup into existing config and untaint. my %setup=%{shift()}; - if (exists $setup{add_plugins}) { + if (exists $setup{add_plugins} && exists $config{add_plugins}) { push @{$setup{add_plugins}}, @{$config{add_plugins}}; } if (exists $setup{exclude}) { @@ -71,9 +72,9 @@ sub merge ($) { wrappermode => (defined $config{cgi_wrappermode} ? $config{cgi_wrappermode} : "06755"), }; } -} #}}} +} -sub getsetup () { #{{{ +sub getsetup () { # Gets all available setup data from all plugins. Returns an # ordered list of [plugin, setup] pairs. my @ret; @@ -105,9 +106,9 @@ sub getsetup () { #{{{ $config{syslog}=$syslog; return @ret; -} #}}} +} -sub dump ($) { #{{{ +sub dump ($) { my $file=IkiWiki::possibly_foolish_untaint(shift); require IkiWiki::Setup::Standard;