+ if ($config{setup}) {
+ delete $config{setup};
+ loadplugins();
+ checkconfig();
+
+ if (@{$config{wrappers}} &&
+ ! $config{render} && ! $config{dumpsetup} &&
+ ((! $config{refresh} && ! $config{post_commit})
+ || $config{genwrappers})) {
+ debug(gettext("generating wrappers.."));
+ require IkiWiki::Wrapper;
+ my %origconfig=(%config);
+ 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{test_receive}) {
+ $config{post_commit}=1;
+ }
+ gen_wrapper();
+ }
+ %config=(%origconfig);
+ }
+
+ # setup implies a wiki rebuild by default
+ if (! $config{refresh} && ! $config{render} &&
+ ! $config{post_commit}) {
+ $config{rebuild}=1;
+ }