summaryrefslogtreecommitdiffstats
path: root/files/reprepro/snapshots
diff options
context:
space:
mode:
authorCyril Brulebois <cyril@debamax.com>2016-04-05 18:37:16 +0200
committerCyril Brulebois <cyril@debamax.com>2016-04-05 18:40:46 +0200
commit7d66dc9cfbdffcc423a164c577e1f061d08f5adb (patch)
treea335926ae515c9eff039775683b7e1682bf12813 /files/reprepro/snapshots
parentaa5656a6692619d80ef58856ec750d458e4017b5 (diff)
Pass --verbose/--silent to reprepro if VERBOSE/SILENT are set.
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-snapshots9
1 files changed, 7 insertions, 2 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 cad3876..90a7fe6 100755
--- a/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
+++ b/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
@@ -67,6 +67,11 @@ verbose_print("reprepro-known snapshot references:", (join "\n - ", '', @reprepr
my $now = DateTime->now();
my $removed = 0;
+
+my $reprepro_options = "-b $archive_dir";
+$reprepro_options .= ' --verbose' if $ENV{VERBOSE};
+$reprepro_options .= ' --silent' if $ENV{SILENT};
+
foreach my $dir (@snapshots_dirs) {
# Let's get the suite name based on the directory name; the
# contents of the Release files might be slightly off, depending
@@ -104,7 +109,7 @@ foreach my $dir (@snapshots_dirs) {
my $db_id = "s=$suite=$timestamp";
if (grep { $db_id eq $_ } @reprepro_references) {
verbose_print(" $db_id found in the db, forgetting\n");
- run("reprepro -b $archive_dir _removereferences $db_id")
+ run("reprepro $reprepro_options _removereferences $db_id")
if ! $dryrun;
$removed++;
verbose_print(" done\n");
@@ -122,7 +127,7 @@ foreach my $dir (@snapshots_dirs) {
if ($removed > 0) {
verbose_print("at least one snapshot was removed, calling reprepro deleteunreferenced\n");
- run("reprepro -b $archive_dir deleteunreferenced")
+ run("reprepro $reprepro_options deleteunreferenced")
if ! $dryrun;
verbose_print("done\n");
}