Options set in the setup file are now immediatly loaded by ikiwiki -setup. This allow...
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 6 Aug 2008 05:58:04 +0000 (01:58 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 6 Aug 2008 05:58:04 +0000 (01:58 -0400)
IkiWiki.pm
IkiWiki/Setup.pm
debian/changelog
ikiwiki.in
po/ikiwiki.pot

index e1c4b6e2fdcb97ac2902c6e6fe0e78061f927ead..e4765219e60bdd9c7408aaf4425b1657ae1f618d 100644 (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,
        },
index e014a2a10a5e59c1ce4f1285a747e698f390d34f..f8bb664c4b46bc716aa6a02fe745ce3483afe794 100644 (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, $!));
index b4bdfeefeb1a3b7603675ca74199b87a9bc80276..e901354eb80c94faef4a63583b290a0a472de860 100644 (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
 
index ddbd710568d67d61cd3aecd3c9970b298e514edf..e0a657cda6e5a32457ff5683a113c0a08f56b8ec 100755 (executable)
@@ -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}) {
index 53f6e0e57e7b1b0cbbd390143e59fb94167bf811..a6328c48d3f3fb5599c328ed64c08bdc4f46052d 100644 (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 ""