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. 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.master
parent
66c589fa81
commit
c51b304d90
|
@ -7,6 +7,9 @@ ikiwiki (2.65) UNRELEASED; urgency=low
|
||||||
elements.
|
elements.
|
||||||
* progress: Display an error if the progress cannot be parsed, and allow
|
* progress: Display an error if the progress cannot be parsed, and allow
|
||||||
the percent parameter to only optionally end with "%".
|
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
|
-- Joey Hess <joeyh@debian.org> Wed, 17 Sep 2008 14:26:56 -0400
|
||||||
|
|
||||||
|
|
22
ikiwiki.in
22
ikiwiki.in
|
@ -21,7 +21,13 @@ sub getconfig () { #{{{
|
||||||
GetOptions(
|
GetOptions(
|
||||||
"setup|s=s" => sub {
|
"setup|s=s" => sub {
|
||||||
require IkiWiki::Setup;
|
require IkiWiki::Setup;
|
||||||
|
my $verbose=$config{verbose};
|
||||||
|
my $syslog=$config{syslog};
|
||||||
IkiWiki::Setup::load($_[1]);
|
IkiWiki::Setup::load($_[1]);
|
||||||
|
$config{setupverbose}=$config{verbose};
|
||||||
|
$config{setupsyslog}=$config{syslog};
|
||||||
|
$config{verbose}=$verbose;
|
||||||
|
$config{syslog}=$syslog;
|
||||||
$config{setup}=1;
|
$config{setup}=1;
|
||||||
},
|
},
|
||||||
"dumpsetup|s=s" => \$config{dumpsetup},
|
"dumpsetup|s=s" => \$config{dumpsetup},
|
||||||
|
@ -129,15 +135,13 @@ sub main () { #{{{
|
||||||
debug(gettext("generating wrappers.."));
|
debug(gettext("generating wrappers.."));
|
||||||
require IkiWiki::Wrapper;
|
require IkiWiki::Wrapper;
|
||||||
my %origconfig=(%config);
|
my %origconfig=(%config);
|
||||||
my @wrappers=@{$config{wrappers}};
|
foreach my $wrapper (@{$config{wrappers}}) {
|
||||||
delete $config{wrappers};
|
%config=(%origconfig, %{$wrapper});
|
||||||
delete $config{genwrappers};
|
$config{verbose}=$config{setupverbose}
|
||||||
foreach my $wrapper (@wrappers) {
|
if exists $config{setupverbose};
|
||||||
%config=(%origconfig,
|
$config{syslog}=$config{setupsyslog}
|
||||||
rebuild => 0,
|
if exists $config{setupsyslog};
|
||||||
verbose => undef,
|
delete @config{qw(setupsyslog setupverbose wrappers genwrappers rebuild)};
|
||||||
%{$wrapper},
|
|
||||||
);
|
|
||||||
checkconfig();
|
checkconfig();
|
||||||
if (! $config{cgi} && ! $config{post_commit}) {
|
if (! $config{cgi} && ! $config{post_commit}) {
|
||||||
$config{post_commit}=1;
|
$config{post_commit}=1;
|
||||||
|
|
Loading…
Reference in New Issue