changes to debug message printing
parent
50a5ab3c4e
commit
51bf0ea529
|
@ -113,46 +113,45 @@ sub launchaggregation () { #{{{
|
||||||
return 1;
|
return 1;
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
|
# Used by ikiwiki-transition aggregateinternal.
|
||||||
sub migrate_to_internal { #{{{
|
sub migrate_to_internal { #{{{
|
||||||
|
|
||||||
if (! lockaggregate()) {
|
if (! lockaggregate()) {
|
||||||
error("an aggregation process is already running");
|
error("an aggregation process is currently running");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IkiWiki::lockwiki();
|
IkiWiki::lockwiki();
|
||||||
loadstate();
|
loadstate();
|
||||||
|
$config{verbose}=1;
|
||||||
|
|
||||||
foreach my $data (values %guids) {
|
foreach my $data (values %guids) {
|
||||||
next unless $data->{page};
|
next unless $data->{page};
|
||||||
|
|
||||||
$config{aggregateinternal} = 0;
|
$config{aggregateinternal} = 0;
|
||||||
my $oldname = pagefile($data->{page});
|
my $oldname = pagefile($data->{page});
|
||||||
|
|
||||||
$config{aggregateinternal} = 1;
|
$config{aggregateinternal} = 1;
|
||||||
my $newname = pagefile($data->{page});
|
my $newname = pagefile($data->{page});
|
||||||
|
|
||||||
print "I: $oldname -> $newname\n";
|
debug "moving $oldname -> $newname";
|
||||||
if (-e $newname) {
|
if (-e $newname) {
|
||||||
if (-e $oldname) {
|
if (-e $oldname) {
|
||||||
error("$newname already exists");
|
error("$newname already exists");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print STDERR
|
debug("already renamed to $newname?");
|
||||||
"W: already renamed to $newname?\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif (-e $oldname) {
|
elsif (-e $oldname) {
|
||||||
rename($oldname, $newname) || error("$!");
|
rename($oldname, $newname) || error("$!");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "W: $oldname not found\n";
|
debug("$oldname not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
savestate();
|
savestate();
|
||||||
IkiWiki::unlockwiki;
|
IkiWiki::unlockwiki;
|
||||||
|
|
||||||
unlockaggregate();
|
unlockaggregate();
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue