boklm pushed to branch main at The Tor Project / Applications / RBM


Commits:
e099ccbd by Nicolas Vigier at 2025-11-19T18:41:01+01:00
Bug 40090: Remove containers using `rm -Rf` instead of pathrmdir

Remove the `container remove` command (based on `pathrmdir` from
File::Copy::Recursive) and instead use `container run -- rm -Rf`, which
was noticed by PieroV to be much faster.

- - - - -


2 changed files:

- container
- lib/RBM/DefaultConfig.pm


Changes:

=====================================
container
=====================================
@@ -10,7 +10,7 @@ use English;
 use Getopt::Long;
 use Path::Tiny;
 use File::Path qw(make_path);
-use File::Copy::Recursive qw(pathrmdir rcopy fcopy);
+use File::Copy::Recursive qw(rcopy fcopy);
 require "syscall.ph";
 
 *CLONE_NEWNS   = \0x20000;
@@ -208,19 +208,6 @@ my %actions = (
             );
         },
     },
-    remove => {
-        descr => "Remove a container directory",
-        usage => "$0 remove <container-dir>",
-        run   => sub {
-            usageexit($ARGV[0]) unless @ARGV == 2;
-            exit_error "$ARGV[1] is not a directory" unless -d $ARGV[1];
-            unshare_run(
-                sub {
-                    return pathrmdir($ARGV[1]);
-                }
-            );
-        },
-    },
     put => {
         descr => "Copy a file or directory to the container directory",
         usage => "$0 put <container-dir> <src> <dst> <owner>",


=====================================
lib/RBM/DefaultConfig.pm
=====================================
@@ -530,7 +530,7 @@ OPT_END
         remote_finish => <<OPT_END,
 #!/bin/sh
 set -e
-[% c("rbmdir") %]/container remove '[% c("container/dir") %]'
+[% c("rbmdir") %]/container run -- rm -Rf -- '[% c("container/dir") %]'
 OPT_END
 ####
 ####



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/rbm/-/commit/e099ccbd0abd1c693f76705a6cb5446d12f0bae2

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/rbm/-/commit/e099ccbd0abd1c693f76705a6cb5446d12f0bae2
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to