aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mageia.org>2015-10-20 10:05:41 +0300
committerThomas Backlund <tmb@mageia.org>2015-10-20 10:05:41 +0300
commit723d7496ba31764f65fae09c85b2386e6ab7f00d (patch)
tree0f8c3a2a29e7034462ef6fc918385b9fb69f43e4
parentbe92cc0c09248d5d6ef9120815ee6d7f27261b80 (diff)
downloadpuppet-723d7496ba31764f65fae09c85b2386e6ab7f00d.tar
puppet-723d7496ba31764f65fae09c85b2386e6ab7f00d.tar.gz
puppet-723d7496ba31764f65fae09c85b2386e6ab7f00d.tar.bz2
puppet-723d7496ba31764f65fae09c85b2386e6ab7f00d.tar.xz
puppet-723d7496ba31764f65fae09c85b2386e6ab7f00d.zip
lint fixes for mirror_cleaner
-rwxr-xr-xmodules/mirror_cleaner/files/orphans_cleaner.pl26
-rw-r--r--modules/mirror_cleaner/manifests/orphans.pp4
2 files changed, 15 insertions, 15 deletions
diff --git a/modules/mirror_cleaner/files/orphans_cleaner.pl b/modules/mirror_cleaner/files/orphans_cleaner.pl
index f1af3dee..0ab84cfa 100755
--- a/modules/mirror_cleaner/files/orphans_cleaner.pl
+++ b/modules/mirror_cleaner/files/orphans_cleaner.pl
@@ -34,11 +34,11 @@ foreach my $a ( @arches ) {
$binary_hdlist = "$rpm_path/media_info/hdlist.cz";
$source_hdlist = "$srpm_path/media_info/hdlist.cz";
- next if not -f $source_hdlist;
- next if not -f $binary_hdlist;
+ next if not -f $source_hdlist;
+ next if not -f $binary_hdlist;
- next if stat($source_hdlist)->size() <= 64;
- next if stat($binary_hdlist)->size() <= 64;
+ next if stat($source_hdlist)->size() <= 64;
+ next if stat($binary_hdlist)->size() <= 64;
open(my $hdfh, "zcat '$binary_hdlist' 2>/dev/null |") or die "Can't open $_";
while (my $hdr = stream2header($hdfh)) {
@@ -60,15 +60,15 @@ foreach my $a ( @arches ) {
# Be safe, maybe hdlists were not in sync
next if -f "$srpm_path/$s";
foreach my $rpm ( @{$hash{$s}} ) {
- $rpm = "$rpm_path/$rpm";
- # sometimes, packages are removed without hdlist to be updated
- next if not -f "$rpm";
- if (time() > $move_delay + stat("$rpm")->ctime()) {
- ( $dest_rpm = $rpm ) =~ s/$path/$dest_path/;
- my $dir = dirname $dest_rpm;
- make_path $dir if not -d $dir;
- move($rpm, $dest_rpm)
- }
+ $rpm = "$rpm_path/$rpm";
+ # sometimes, packages are removed without hdlist to be updated
+ next if not -f "$rpm";
+ if (time() > $move_delay + stat("$rpm")->ctime()) {
+ ( $dest_rpm = $rpm ) =~ s/$path/$dest_path/;
+ my $dir = dirname $dest_rpm;
+ make_path $dir if not -d $dir;
+ move($rpm, $dest_rpm)
+ }
}
}
}
diff --git a/modules/mirror_cleaner/manifests/orphans.pp b/modules/mirror_cleaner/manifests/orphans.pp
index 135fc822..90454afa 100644
--- a/modules/mirror_cleaner/manifests/orphans.pp
+++ b/modules/mirror_cleaner/manifests/orphans.pp
@@ -7,8 +7,8 @@ define mirror_cleaner::orphans($base) {
ensure => directory
}
- cron { "clean orphans $name":
- command => "/usr/local/bin/orphans_cleaner.pl $base/$name $orphan_dir",
+ cron { "clean orphans ${name}":
+ command => "/usr/local/bin/orphans_cleaner.pl ${base}/${name} ${orphan_dir}",
hour => 5,
minute => 30,
user => root,