]> Sergey Matveev's repositories - public-inbox.git/commitdiff
xapcmd: do not cleanup on errors
authorEric Wong <e@80x24.org>
Thu, 23 May 2019 09:36:47 +0000 (09:36 +0000)
committerEric Wong <e@80x24.org>
Thu, 23 May 2019 17:43:50 +0000 (17:43 +0000)
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

index 999ddd1cb239cefe57eaaaa70e866f30a311ac32..81e2f1017e854c294922a78c3fba9e5f29bcce1f 100644 (file)
@@ -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) {