summaryrefslogtreecommitdiffstats
path: root/files/reprepro/snapshots
diff options
context:
space:
mode:
authorCyril Brulebois <cyril@debamax.com>2016-04-05 19:30:12 +0200
committerCyril Brulebois <cyril@debamax.com>2016-04-05 19:47:39 +0200
commit63dd815f7bdca112aac17a7653f6ca4bd37f7a03 (patch)
tree8b189c5a06d3794c6788b789c865b8b836ce728e /files/reprepro/snapshots
parent228c4d561fb0b8e932fbc1e3c5d48c20cb2ce1e8 (diff)
Implement the removal of leftover files under dists/ directory.
Signed-off-by: Cyril Brulebois <cyril@debamax.com>
Diffstat (limited to 'files/reprepro/snapshots')
-rwxr-xr-xfiles/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots13
1 files changed, 10 insertions, 3 deletions
diff --git a/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots b/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
index 96048e5..57e2ac5 100755
--- a/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
+++ b/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
@@ -12,6 +12,7 @@ use DateTime;
use DateTime::Format::Mail;
use File::Basename;
use File::Find::Rule;
+use File::Path qw(remove_tree);
use File::Slurp;
use Getopt::Long;
use IPC::System::Simple qw(capturex runx);
@@ -120,9 +121,15 @@ foreach my $dir (@snapshots_dirs) {
}
}
- # Let's remove the snapshot entirely:
- print " XXX: should be removing the tree below: $snapshot\n"
- if ! $dryrun;
+ # Remove actual files:
+ if ($dryrun) {
+ verbose_print(" should be removing: $db_id\n");
+ }
+ else {
+ verbose_print(" removing: $snapshot\n");
+ my $rm_files = remove_tree($snapshot);
+ verbose_print(" removed: $rm_files files\n");
+ }
}
else {
verbose_print(" nothing to do\n");