Fix reversion in use of ikiwiki -verbose -setup with a setup file that enables syslog.
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 20 Sep 2008 19:36:32 +0000 (15:36 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 20 Sep 2008 19:38:02 +0000 (15:38 -0400)
Setup output is once again output to stdout in this case.

Implemented by stashing the verbose/syslog values set in the setup file,
and using those values in the generated wrappers, but not allowing them to take
effect during the setup operation itself, so that command-line options,
appearing before or after -setup, are honored.

Also, some cleanups to how %config is generated for wrappers, removing some
fields that do not need to be recorded inside the wrapper.

debian/changelog
ikiwiki.in

index ffa26613754f0acd1091d8cdbc9e7e24c44f8d0e..a44b890581351381988a3e4dd9c68939d854349f 100644 (file)
@@ -7,6 +7,9 @@ ikiwiki (2.65) UNRELEASED; urgency=low
     elements.
   * progress: Display an error if the progress cannot be parsed, and allow
     the percent parameter to only optionally end with "%".
+  * Fix reversion in use of ikiwiki -verbose -setup with a setup file that
+    enables syslog. Setup output is once again output to stdout in this
+    case.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 17 Sep 2008 14:26:56 -0400
 
index 878d3506519a02e496fdb13564c4591a8d6fb0ea..5c2d710b9c75e1eb045b70c1f5930a96865aab89 100755 (executable)
@@ -21,7 +21,13 @@ sub getconfig () { #{{{
                GetOptions(
                        "setup|s=s" => sub {
                                require IkiWiki::Setup;
+                               my $verbose=$config{verbose};
+                               my $syslog=$config{syslog};
                                IkiWiki::Setup::load($_[1]);
+                               $config{setupverbose}=$config{verbose};
+                               $config{setupsyslog}=$config{syslog};
+                               $config{verbose}=$verbose;
+                               $config{syslog}=$syslog;
                                $config{setup}=1;
                        },
                        "dumpsetup|s=s" => \$config{dumpsetup},
@@ -129,15 +135,13 @@ sub main () { #{{{
                        debug(gettext("generating wrappers.."));
                        require IkiWiki::Wrapper;
                        my %origconfig=(%config);
-                       my @wrappers=@{$config{wrappers}};
-                       delete $config{wrappers};
-                       delete $config{genwrappers};
-                       foreach my $wrapper (@wrappers) {
-                               %config=(%origconfig,
-                                       rebuild => 0,
-                                       verbose => undef,
-                                       %{$wrapper},
-                               );
+                       foreach my $wrapper (@{$config{wrappers}}) {
+                               %config=(%origconfig, %{$wrapper});
+                               $config{verbose}=$config{setupverbose}
+                                       if exists $config{setupverbose};
+                               $config{syslog}=$config{setupsyslog}
+                                       if exists $config{setupsyslog};
+                               delete @config{qw(setupsyslog setupverbose wrappers genwrappers rebuild)};
                                checkconfig();
                                if (! $config{cgi} && ! $config{post_commit}) {
                                        $config{post_commit}=1;