ikiwiki-transition: If passed a nonexistant srcdir, or one not containing .ikiwiki, abort with an error rather than creating it.
parent
fdfaa1b515
commit
9f5f5543bf
|
@ -1,3 +1,10 @@
|
||||||
|
ikiwiki (3.13) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
* ikiwiki-transition: If passed a nonexistant srcdir, or one not
|
||||||
|
containing .ikiwiki, abort with an error rather than creating it.
|
||||||
|
|
||||||
|
-- Joey Hess <joeyh@debian.org> Wed, 06 May 2009 20:45:44 -0400
|
||||||
|
|
||||||
ikiwiki (3.12) unstable; urgency=low
|
ikiwiki (3.12) unstable; urgency=low
|
||||||
|
|
||||||
* Re-enable python-support and add python:Depends to control file.
|
* Re-enable python-support and add python:Depends to control file.
|
||||||
|
|
|
@ -73,11 +73,7 @@ sub prefix_directives {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub indexdb {
|
sub indexdb {
|
||||||
my $dir=shift;
|
setstatedir(shift);
|
||||||
if (! defined $dir) {
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
$config{wikistatedir}=$dir."/.ikiwiki";
|
|
||||||
|
|
||||||
# Note: No lockwiki here because ikiwiki already locks it
|
# Note: No lockwiki here because ikiwiki already locks it
|
||||||
# before calling this.
|
# before calling this.
|
||||||
|
@ -96,11 +92,7 @@ sub indexdb {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub hashpassword {
|
sub hashpassword {
|
||||||
my $dir=shift;
|
setstatedir(shift);
|
||||||
if (! defined $dir) {
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
$config{wikistatedir}=$dir."/.ikiwiki";
|
|
||||||
|
|
||||||
eval q{use IkiWiki::UserInfo};
|
eval q{use IkiWiki::UserInfo};
|
||||||
eval q{use Authen::Passphrase::BlowfishCrypt};
|
eval q{use Authen::Passphrase::BlowfishCrypt};
|
||||||
|
@ -221,11 +213,7 @@ sub moveprefs {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub deduplinks {
|
sub deduplinks {
|
||||||
my $dir=shift;
|
setstatdir(shift);
|
||||||
if (! defined $dir) {
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
$config{wikistatedir}=$dir."/.ikiwiki";
|
|
||||||
IkiWiki::loadindex();
|
IkiWiki::loadindex();
|
||||||
foreach my $page (keys %links) {
|
foreach my $page (keys %links) {
|
||||||
my %l;
|
my %l;
|
||||||
|
@ -235,6 +223,24 @@ sub deduplinks {
|
||||||
IkiWiki::saveindex();
|
IkiWiki::saveindex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub setstatedir {
|
||||||
|
my $dir=shift;
|
||||||
|
|
||||||
|
if (! defined $dir) {
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! -d $dir) {
|
||||||
|
error("ikiwiki-transition: $dir does not exist");
|
||||||
|
}
|
||||||
|
|
||||||
|
$config{wikistatedir}=$dir."/.ikiwiki";
|
||||||
|
|
||||||
|
if (! -d $config{wikistatedir}) {
|
||||||
|
error("ikiwiki-transition: $config{wikistatedir} does not exist");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub usage {
|
sub usage {
|
||||||
print STDERR "Usage: ikiwiki-transition type ...\n";
|
print STDERR "Usage: ikiwiki-transition type ...\n";
|
||||||
print STDERR "Currently supported transition subcommands:\n";
|
print STDERR "Currently supported transition subcommands:\n";
|
||||||
|
|
Loading…
Reference in New Issue