summaryrefslogtreecommitdiff
path: root/ikiwiki.in
diff options
context:
space:
mode:
Diffstat (limited to 'ikiwiki.in')
-rwxr-xr-xikiwiki.in49
1 files changed, 48 insertions, 1 deletions
diff --git a/ikiwiki.in b/ikiwiki.in
index f48f2cfeb..0f82f77ac 100755
--- a/ikiwiki.in
+++ b/ikiwiki.in
@@ -20,6 +20,7 @@ sub getconfig () { #{{{
Getopt::Long::Configure('pass_through');
GetOptions(
"setup|s=s" => \$config{setup},
+ "dumpsetup|s=s" => \$config{dumpsetup},
"wikiname=s" => \$config{wikiname},
"verbose|v!" => \$config{verbose},
"syslog!" => \$config{syslog},
@@ -111,7 +112,46 @@ sub main () { #{{{
if ($config{setup}) {
require IkiWiki::Setup;
- setup();
+ IkiWiki::Setup::load($config{setup});
+ if (! $config{render} && ! $config{dumpsetup} &&
+ (! $config{refresh} || $config{wrappers})) {
+ debug(gettext("generating wrappers.."));
+ require IkiWiki::Wrapper;
+ my %origconfig=(%config);
+ my @wrappers=@{$config{wrappers}};
+ delete $config{wrappers};
+ foreach my $wrapper (@wrappers) {
+ %config=(%origconfig,
+ rebuild => 0,
+ verbose => 0,
+ %{$wrapper},
+ );
+ checkconfig();
+ if (! $config{cgi} && ! $config{post_commit}) {
+ $config{post_commit}=1;
+ }
+ gen_wrapper();
+ }
+ %config=(%origconfig);
+ }
+
+ # setup implies a wiki rebuild by default
+ if (! $config{refresh}) {
+ $config{rebuild}=1;
+ }
+
+ # ignore syslog setting from setup file
+ # while doing initial setup
+ $config{syslog}=0;
+
+ loadplugins();
+ checkconfig();
+ }
+
+ if ($config{dumpsetup}) {
+ loadplugins();
+ checkconfig();
+ IkiWiki::Setup::dump($config{dumpsetup});
}
elsif ($config{wrapper}) {
lockwiki();
@@ -133,12 +173,19 @@ sub main () { #{{{
# do nothing
}
else {
+ if (! $config{refresh}) {
+ debug(gettext("rebuilding wiki.."));
+ }
+ else {
+ debug(gettext("refreshing wiki.."));
+ }
lockwiki();
loadindex();
require IkiWiki::Render;
rcs_update();
refresh();
saveindex();
+ debug(gettext("done"));
}
} #}}}