aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-24 15:36:34 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-24 15:36:34 +0000
commit43447dae9a616c92bd4ca5910002d162c06a611f (patch)
tree7310fed1ccf3835949ff461dcec5206c1de3713a /lib
parentb1a4966c165963b91436bcce74d7d5d69b4aa510 (diff)
downloadiurt-43447dae9a616c92bd4ca5910002d162c06a611f.tar
iurt-43447dae9a616c92bd4ca5910002d162c06a611f.tar.gz
iurt-43447dae9a616c92bd4ca5910002d162c06a611f.tar.bz2
iurt-43447dae9a616c92bd4ca5910002d162c06a611f.tar.xz
iurt-43447dae9a616c92bd4ca5910002d162c06a611f.zip
perl_checker cleanups
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Chroot.pm10
-rw-r--r--lib/Iurt/Mail.pm4
-rw-r--r--lib/Iurt/Urpmi.pm2
3 files changed, 6 insertions, 10 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index 77a1463..f5d9880 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -55,7 +55,7 @@ sub clean_chroot {
open(my $FP, "/proc/mounts") or die $!;
my @list = grep { /$chroot/ } <$FP>;
close($FP);
- if ($#list >= 0) {
+ if (@list >= 0) {
# Still referenced
return 1;
}
@@ -180,7 +180,6 @@ sub dump_rpmmacros {
sub add_local_user {
my ($chroot_tmp, $run, $config, $luser, $uid) = @_;
- my $program_name = $run->{program_name};
# change the builder user to the local user id
# FIXME it seems that unionfs does not handle well the change of the
@@ -205,10 +204,7 @@ sub add_local_user {
}
sub create_temp_chroot {
- my ($run, $config, $cache, $chroot_tmp, $chroot_tar, $o_srpm) = @_;
-
- my $home = $config->{local_home};
- my $debug_tag = $run->{debug_tag};
+ my ($run, $config, $_cache, $chroot_tmp, $chroot_tar, $o_srpm) = @_;
plog("Install new chroot");
plog('DEBUG', "... in $chroot_tmp");
@@ -328,7 +324,7 @@ sub create_chroot {
sudo($run, $config, '--untar', $chroot_tar, $tmp_chroot, "./var/log/qa");
my $tmp_urpmi = mktemp("$chroot.tmp.XXXXXX");
- my @installed_pkgs = grep(!/^gpg-pubkey/, chomp_(cat_("$tmp_chroot/var/log/qa")));
+ my @installed_pkgs = grep { !/^gpg-pubkey/ } chomp_(cat_("$tmp_chroot/var/log/qa"));
my @available_pkgs = chomp_(`urpmq --urpmi-root $tmp_urpmi --use-distrib $run->{urpmi}{distrib_url} --list -f 2>/dev/null`);
my @removed_pkgs = difference2(\@installed_pkgs, \@available_pkgs);
rm_rf($tmp_urpmi);
diff --git a/lib/Iurt/Mail.pm b/lib/Iurt/Mail.pm
index 6a9edb6..a268b2c 100644
--- a/lib/Iurt/Mail.pm
+++ b/lib/Iurt/Mail.pm
@@ -9,7 +9,7 @@ our @EXPORT = qw(
);
sub expand_email {
- my($email, $config) = @_;
+ my ($email, $config) = @_;
return $email unless $config->{email_domain};
my $name = "";
my $addr = $email;
@@ -35,7 +35,7 @@ sub sendmail {
if ($cc) {
$cc = expand_email($cc, $config);
$cc = encode_mimewords($cc);
- print $MAIL "Cc: $cc\n"
+ print $MAIL "Cc: $cc\n";
}
print $MAIL "From: $from\n";
print $MAIL "Subject: $subject\n";
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index 3ec70d3..3c5e4e3 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -302,7 +302,7 @@ sub get_build_requires {
$run->{todo_requires} = {};
plog("get_build_requires");
- my ($u_id, $chroot_tmp) = create_temp_chroot($run, $config, $cache, $run->{chroot_tmp}, $run->{chroot_tar}) or return;
+ my (undef, $chroot_tmp) = create_temp_chroot($run, $config, $cache, $run->{chroot_tmp}, $run->{chroot_tar}) or return;
add_local_user($chroot_tmp, $run, $config, $luser, $run->{uid}) or return;
my $urpm = new URPM;