chiark / gitweb /
git-cache-proxy: housekeeping: use rm -rf, not remove_tree (which is weirdly broken)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 28 Jul 2014 14:50:59 +0000 (15:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 28 Jul 2014 14:50:59 +0000 (15:50 +0100)
scripts/git-cache-proxy

index 9720a69..438dbf5 100755 (executable)
@@ -415,14 +415,9 @@ sub housekeeping () {
                        die "$dir: cannot rename to $tdir: $!\n";
                    }
                }
-               my $errs;
-               remove_tree($tdir, { safe=>1, error=>\$errs });
-               if (!stat $tdir) {
-                   foreach my $err (@$errs) {
-                       my ($file, $message) = %$err;
-                       logm 'info', "problem deleting: $file: $message";
-                   }
-                   die "$dir: problem deleting file(s)\n";
+               system qw(rm -rf --), $tdir;
+               if (stat $tdir) {
+                   die "$dir: problem deleting file(s), rm exited $?\n";
                } elsif ($! != ENOENT) {
                    die "$tdir: cannot stat after deletion: $!\n";
                }