]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
xapcmd: rely on File::Temp cleanup for temporary dir
authorEric Wong <e@80x24.org>
Thu, 8 Jun 2023 18:04:54 +0000 (18:04 +0000)
committerEric Wong <e@80x24.org>
Fri, 9 Jun 2023 09:21:28 +0000 (09:21 +0000)
remove_tree from File::Path 2.09 (from Perl 5.16.3 on CentOS 7.x)
doesn't seem to work properly on File::Temp objects.   Since
File::Temp->newdir sets CLEANUP=>1 by default anyways, we'll
just rely on that to perform cleanup instead of doing it ourselves.

lib/PublicInbox/Xapcmd.pm

index ff5c0eab5d8c269eed47ebdf0fa2f0c53910b5d6..4e055acf956732631822ca90db20f6763fab5e38 100644 (file)
@@ -589,7 +589,6 @@ sub cpdb ($$) { # cb_spawn callback
        # this is probably the best place to do xapian-compact
        # since $dst isn't readable by HTTP or NNTP clients, yet:
        compact([ $tmp, $new ], $opt);
-       remove_tree($tmp) or die "failed to remove $tmp: $!\n";
 }
 
 1;