We move the old directory into the new directory, so avoid the
situation where a bug or error could cause the tempdir cleanup to run
and destroy both our old and new directories.
---
lib/PublicInbox/Xapcmd.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm
index 999ddd1..81e2f10 100644
--- a/lib/PublicInbox/Xapcmd.pm
+++ b/lib/PublicInbox/Xapcmd.pm
@@ -32,7 +32,7 @@ sub run {
$ibx->umask_prepare;
my $old = $ibx->search->xdir(1);
-d $old or die "$old does not exist\n";
- my $new = tempdir($cmd->[0].'-XXXXXXXX', CLEANUP => 1, DIR => $dir);
+ my $new = tempdir($cmd->[0].'-XXXXXXXX', DIR => $dir);
my $v = $ibx->{version} || 1;
my @cmds;
if ($v == 1) {
--
EW
--
unsubscribe: [email protected]
archive: https://public-inbox.org/meta/