summaryrefslogtreecommitdiffstats
path: root/files/reprepro/snapshots/time_based
diff options
context:
space:
mode:
authorCyril Brulebois <cyril@debamax.com>2016-04-05 18:49:42 +0200
committerCyril Brulebois <cyril@debamax.com>2016-04-05 19:05:48 +0200
commit8c9f307ece2dc0015ad6dbd8241f012d472eee71 (patch)
treed9dc837d1f40083e1cb7b05620ccafdd7b8de446 /files/reprepro/snapshots/time_based
parent3002c6aa01d0f46e778cad88438adacec1185143 (diff)
Switch from run to runx to avoid the shell.
Better be safe than sorry. Signed-off-by: Cyril Brulebois <cyril@debamax.com>
Diffstat (limited to 'files/reprepro/snapshots/time_based')
-rwxr-xr-xfiles/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots12
1 files changed, 6 insertions, 6 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 159cfde..93cefcb 100755
--- a/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
+++ b/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
@@ -14,7 +14,7 @@ use File::Basename;
use File::Find::Rule;
use File::Slurp;
use Getopt::Long;
-use IPC::System::Simple qw(capture run);
+use IPC::System::Simple qw(capture runx);
use List::MoreUtils qw(uniq);
@@ -68,9 +68,9 @@ 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};
+my @reprepro_options = ('-b', $archive_dir);
+push @reprepro_options, '--verbose' if $ENV{VERBOSE};
+push @reprepro_options, '--silent' if $ENV{SILENT};
foreach my $dir (@snapshots_dirs) {
# Let's get the suite name based on the directory name; the
@@ -113,7 +113,7 @@ foreach my $dir (@snapshots_dirs) {
}
else {
verbose_print(" forgetting: $db_id\n");
- run("reprepro $reprepro_options _removereferences $db_id");
+ runx('reprepro', @reprepro_options, '_removereferences', $db_id);
$removed++;
verbose_print(" forgotten: $db_id\n");
}
@@ -131,7 +131,7 @@ foreach my $dir (@snapshots_dirs) {
if ($removed > 0) {
verbose_print("at least one snapshot was removed, calling reprepro deleteunreferenced\n");
- run("reprepro $reprepro_options deleteunreferenced")
+ runx('reprepro', @reprepro_options, 'deleteunreferenced')
if ! $dryrun;
verbose_print("done\n");
}