From: Joey Hess Date: Sun, 27 Jul 2008 20:01:29 +0000 (-0400) Subject: add new wiki to wikilist X-Git-Tag: 2.60~154 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=950850f63911d7f54f23e0699f820369b32a3532;p=ikiwiki.git add new wiki to wikilist --- diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 202c5541c..b5cf8fb48 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -110,6 +110,17 @@ sub import (@) { #{{{ die "ikiwiki --wrappers --setup $config{dumpsetup} failed"; } + # Add it to the wikiwiki. + mkpath("$ENV{HOME}/.ikiwiki"); + open (WIKILIST, ">>$ENV{HOME}/.ikiwiki/wikilist") || die "$ENV{HOME}/.ikiwiki/wikilist: $!"; + print WIKILIST "$ENV{USER} $config{dumpsetup}\n"; + close WIKILIST; + if (system("ikiwiki-update-wikilist") != 0) { + print STDERR "** Failed to add you to the system wikilist file.\n"; + print STDERR "** (Probably ikiwiki-update-wikilist is not SUID root.)\n"; + print STDERR "** Your wiki will not be automatically updated when ikiwiki is upgraded.\n"; + } + # Done! print "\n\nSuccessfully set up $config{wikiname}:\n"; foreach my $key (qw{url srcdir destdir repository}) { diff --git a/ikiwiki-update-wikilist b/ikiwiki-update-wikilist index 0b52543cd..a6425f011 100755 --- a/ikiwiki-update-wikilist +++ b/ikiwiki-update-wikilist @@ -45,7 +45,7 @@ if (! $seen && ! $remove) { } if ($changed) { close $list || die "ikiwiki-update-wikilist: error reading $list: $!\n"; - open ($list, ">$wikilist") || die "ikiwiki-update-wikilist: error writing $wikilist: $!\n"; + open ($list, ">$wikilist") || die "ikiwiki-update-wikilist: cannot write to $wikilist\n"; foreach (@lines) { print $list "$_\n"; }