Options set in the setup file are now immediatly loaded by ikiwiki -setup. This allows later switches to override them. Previously, setup file options overrode most command line options.

master
Joey Hess 2008-08-06 01:58:04 -04:00
parent 6fb6d51524
commit adc2eb3d8c
5 changed files with 32 additions and 24 deletions

View File

@ -354,6 +354,13 @@ sub getsetup () { #{{{
safe => 0,
rebuild => 0,
},
setup => {
type => "internal",
default => undef,
description => "running in setup mode",
safe => 0,
rebuild => 0,
},
refresh => {
type => "internal",
default => 0,
@ -375,10 +382,10 @@ sub getsetup () { #{{{
safe => 0,
rebuild => 0,
},
setup => {
setupfile => {
type => "internal",
default => undef,
description => "setup file to read",
description => "path to setup file",
safe => 0,
rebuild => 0,
},

View File

@ -12,8 +12,8 @@ use File::Spec;
sub load ($) { # {{{
my $setup=IkiWiki::possibly_foolish_untaint(shift);
$config{setupfile}=File::Spec->rel2abs($config{setup});
delete $config{setup};
$config{setupfile}=File::Spec->rel2abs($setup);
#translators: The first parameter is a filename, and the second
#translators: is a (probably not translated) error message.
open (IN, $setup) || error(sprintf(gettext("cannot read %s: %s"), $setup, $!));

3
debian/changelog vendored
View File

@ -25,6 +25,9 @@ ikiwiki (2.60) UNRELEASED; urgency=low
account. Also, avoid making index pages for directories that contain
no files.
* external: Fix support for hooks called in an array context.
* Options set in the setup file are now immediatly loaded by ikiwiki -setup.
This allows later switches to override them. Previously, setup file
options overrode most command line options.
-- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2008 11:35:46 -0400

View File

@ -19,7 +19,11 @@ sub getconfig () { #{{{
eval q{use Getopt::Long};
Getopt::Long::Configure('pass_through');
GetOptions(
"setup|s=s" => \$config{setup},
"setup|s=s" => sub {
require IkiWiki::Setup;
IkiWiki::Setup::load($_[1]);
$config{setup}=1;
},
"dumpsetup|s=s" => \$config{dumpsetup},
"wikiname=s" => \$config{wikiname},
"verbose|v!" => \$config{verbose},
@ -115,9 +119,7 @@ sub main () { #{{{
getconfig();
if ($config{setup}) {
require IkiWiki::Setup;
IkiWiki::Setup::load($config{setup});
delete $config{setup};
loadplugins();
checkconfig();
@ -149,10 +151,6 @@ sub main () { #{{{
if (! $config{refresh}) {
$config{rebuild}=1;
}
# ignore syslog setting from setup file
# while doing initial setup
$config{syslog}=0 unless $config{dumpsetup};
}
if ($config{dumpsetup}) {

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-08-05 20:43-0400\n"
"POT-Creation-Date: 2008-08-06 01:51-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -71,7 +71,7 @@ msgstr ""
msgid "You are banned."
msgstr ""
#: ../IkiWiki/CGI.pm:783 ../IkiWiki/CGI.pm:784 ../IkiWiki.pm:1110
#: ../IkiWiki/CGI.pm:783 ../IkiWiki/CGI.pm:784 ../IkiWiki.pm:1117
msgid "Error"
msgstr ""
@ -152,7 +152,7 @@ msgstr ""
msgid "deleting bucket.."
msgstr ""
#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:194
#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:192
msgid "done"
msgstr ""
@ -190,7 +190,7 @@ msgstr ""
msgid "attachment upload"
msgstr ""
#: ../IkiWiki/Plugin/autoindex.pm:74
#: ../IkiWiki/Plugin/autoindex.pm:77
msgid "automatic index generation"
msgstr ""
@ -836,35 +836,35 @@ msgstr ""
msgid "usage: ikiwiki [options] source dest"
msgstr ""
#: ../ikiwiki.in:79
#: ../ikiwiki.in:83
msgid "usage: --set var=value"
msgstr ""
#: ../ikiwiki.in:127
#: ../ikiwiki.in:129
msgid "generating wrappers.."
msgstr ""
#: ../ikiwiki.in:183
#: ../ikiwiki.in:181
msgid "rebuilding wiki.."
msgstr ""
#: ../ikiwiki.in:186
#: ../ikiwiki.in:184
msgid "refreshing wiki.."
msgstr ""
#: ../IkiWiki.pm:427
#: ../IkiWiki.pm:434
msgid "Must specify url to wiki with --url when using --cgi"
msgstr ""
#: ../IkiWiki.pm:471
#: ../IkiWiki.pm:478
msgid "cannot use multiple rcs plugins"
msgstr ""
#: ../IkiWiki.pm:1093
#: ../IkiWiki.pm:1100
#, perl-format
msgid "preprocessing loop detected on %s at depth %i"
msgstr ""
#: ../IkiWiki.pm:1581
#: ../IkiWiki.pm:1588
msgid "yes"
msgstr ""