aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-24 15:37:02 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-24 15:37:02 +0000
commitccccf8692eca0ef709fb8fabc36d65e53a07c23e (patch)
treeccdf8a8d339a3be23f3eaba840a94db308a2eb76 /lib
parentee9645ee5c60ee5bdce25de9c6a85c5e6a5d3baf (diff)
downloadiurt-ccccf8692eca0ef709fb8fabc36d65e53a07c23e.tar
iurt-ccccf8692eca0ef709fb8fabc36d65e53a07c23e.tar.gz
iurt-ccccf8692eca0ef709fb8fabc36d65e53a07c23e.tar.bz2
iurt-ccccf8692eca0ef709fb8fabc36d65e53a07c23e.tar.xz
iurt-ccccf8692eca0ef709fb8fabc36d65e53a07c23e.zip
(sudo) kill unused arg
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Chroot.pm78
-rw-r--r--lib/Iurt/DKMS.pm4
-rw-r--r--lib/Iurt/Process.pm2
-rw-r--r--lib/Iurt/Urpmi.pm6
4 files changed, 45 insertions, 45 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index fc40ef5..d8eca35 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -41,13 +41,13 @@ sub clean_chroot {
plog('DEBUG', "clean chroot");
if (-d $chroot && !$o_only_tar) {
- sudo($run, $config, "--umount", "$chroot/proc");
- sudo($run, $config, "--umount", "$chroot/dev/pts");
+ sudo($config, "--umount", "$chroot/proc");
+ sudo($config, "--umount", "$chroot/dev/pts");
if ($run->{icecream}) {
- sudo($run, $config, "--umount", "$chroot/var/cache/icecream");
+ sudo($config, "--umount", "$chroot/var/cache/icecream");
}
if (-d "$chroot/urpmi_medias/") {
- sudo($run, $config, "--umount", "$chroot/urpmi_medias");
+ sudo($config, "--umount", "$chroot/urpmi_medias");
}
# Do not run rm if there is something still mounted there
@@ -59,7 +59,7 @@ sub clean_chroot {
return 1;
}
- sudo($run, $config, '--rm', '-r', $chroot);
+ sudo($config, '--rm', '-r', $chroot);
}
return 1 if $o_only_clean;
@@ -74,7 +74,7 @@ sub clean_chroot {
return 1;
}
- sudo($run, $config, '--untar', $chroot_tar, $chroot);
+ sudo($config, '--untar', $chroot_tar, $chroot);
if (!create_build_chroot($chroot, $chroot_tar, $run, $config)) {
plog('ERROR', "Failed to create chroot");
return;
@@ -84,21 +84,21 @@ sub clean_chroot {
plog('ERROR', "Failed to dump macros");
return;
}
- if (!sudo($run, $config, '--bindmount', "/proc", "$chroot/proc")) {
+ if (!sudo($config, '--bindmount', "/proc", "$chroot/proc")) {
plog('ERROR', "Failed to mount proc");
return;
}
- if (!sudo($run, $config, '--bindmount', "/dev/pts", "$chroot/dev/pts")) {
+ if (!sudo($config, '--bindmount', "/dev/pts", "$chroot/dev/pts")) {
plog('ERROR', "Failed to mount dev/pts");
- sudo($run, $config, "--umount", "$chroot/proc");
+ sudo($config, "--umount", "$chroot/proc");
return;
}
if ($run->{icecream}) {
system("$sudo mkdir -p $chroot/var/cache/icecream");
- if (!sudo($run, $config, '--bindmount', "/var/cache/icecream", "$chroot/var/cache/icecream")) {
+ if (!sudo($config, '--bindmount', "/var/cache/icecream", "$chroot/var/cache/icecream")) {
plog('ERROR', "Failed to mount var/cache/icecream");
- sudo($run, $config, "--umount", "$chroot/proc");
- sudo($run, $config, "--umount", "$chroot/dev/pts");
+ sudo($config, "--umount", "$chroot/proc");
+ sudo($config, "--umount", "$chroot/dev/pts");
return;
}
}
@@ -109,13 +109,13 @@ sub clean_chroot {
my $mount_point = "$chroot/urpmi_medias";
my $url = $rep;
$url =~ s!^file://!!;
- sudo($run, $config, '--mkdir', '-p', $mount_point);
- if (!sudo($run, $config, '--bindmount', $url, $mount_point)) {
+ sudo($config, '--mkdir', '-p', $mount_point);
+ if (!sudo($config, '--bindmount', $url, $mount_point)) {
plog('ERROR', "Failed to mount $url on $mount_point");
- sudo($run, $config, "--umount", "$chroot/proc");
- sudo($run, $config, "--umount", "$chroot/dev/pts");
+ sudo($config, "--umount", "$chroot/proc");
+ sudo($config, "--umount", "$chroot/dev/pts");
if ($run->{icecream}) {
- sudo($run, $config, "--umount", "$chroot/var/cache/icecream");
+ sudo($config, "--umount", "$chroot/var/cache/icecream");
}
return;
}
@@ -168,7 +168,7 @@ sub dump_rpmmacros {
print $f join "\n", @{$run->{rpmmacros}} if defined $run->{rpmmacros};
close $f;
- my $ret = sudo($run, $config, '--cp', $tmpfile, $file);
+ my $ret = sudo($config, '--cp', $tmpfile, $file);
unlink $tmpfile;
if (!$ret) {
@@ -188,7 +188,7 @@ sub add_local_user {
# if (system(qq|sudo chroot $chroot_tmp usermod -u $run->{uid} builder|)) {
if ($uid) {
- if (!sudo($run, $config, "--useradd", $chroot_tmp, $luser, $uid)) {
+ if (!sudo($config, "--useradd", $chroot_tmp, $luser, $uid)) {
plog('ERROR', "ERROR: setting userid $uid to $luser in " .
"$chroot_tmp failed, checking the chroot");
check_build_chroot($run->{chroot_path}, $run->{chroot_tar}, $run,
@@ -308,7 +308,7 @@ sub create_chroot {
my $rebuild;
my $clean = sub {
plog("Remove temporary chroot tarball");
- sudo($run, $config, '--rm', '-r', $tmp_chroot, $tmp_tar);
+ sudo($config, '--rm', '-r', $tmp_chroot, $tmp_tar);
};
plog('NOTIFY', "creating chroot");
@@ -322,7 +322,7 @@ sub create_chroot {
link $chroot_tar, $tmp_tar or die "FATAL: could not initialize chroot ($!)\n";
plog('DEBUG', "decompressing /var/log/qa from $chroot_tar in $tmp_chroot");
- sudo($run, $config, '--untar', $chroot_tar, $tmp_chroot, "./var/log/qa");
+ sudo($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"));
@@ -350,7 +350,7 @@ sub create_chroot {
if (!build_chroot($run, $config, $tmp_chroot, $chroot_tar, $opt)) {
plog('NOTIFY', "creating chroot failed.");
$clean->();
- sudo($run, $config, '--rm', '-r', $chroot, $chroot_tar);
+ sudo($config, '--rm', '-r', $chroot, $chroot_tar);
return;
}
}
@@ -360,9 +360,9 @@ sub create_chroot {
plog('NOTIFY', "recreate chroot");
my $urpmi = $run->{urpmi};
$urpmi->clean_urpmi_process($chroot);
- sudo($run, $config, '--rm', '-r', $chroot, $tmp_tar);
+ sudo($config, '--rm', '-r', $chroot, $tmp_tar);
mkdir_p $chroot;
- sudo($run, $config, '--untar', $chroot_tar, $chroot);
+ sudo($config, '--untar', $chroot_tar, $chroot);
plog('NOTIFY', "chroot recreated in $chroot_tar (live in $chroot)");
}
@@ -377,15 +377,15 @@ sub build_chroot {
plog('DEBUG', "building the chroot with "
. join(', ', @{$opt->{packages}}));
- sudo($run, $config, "--mkdir", "-p", "$tmp_chroot/dev/pts",
+ sudo($config, "--mkdir", "-p", "$tmp_chroot/dev/pts",
"$tmp_chroot/etc/sysconfig", "$tmp_chroot/proc",
"$tmp_chroot/var/lib/rpm");
#system(qq($sudo sh -c "echo 127.0.0.1 localhost > $tmp_chroot/etc/hosts"));
# warly some program perform a gethostbyname(hostname) and in the cluster the
# name are not resolved via DNS but via /etc/hosts
- sudo($run, $config, '--cp', "/etc/hosts", "$tmp_chroot/etc/");
- sudo($run, $config, '--cp', "/etc/resolv.conf", "$tmp_chroot/etc/");
+ sudo($config, '--cp', "/etc/hosts", "$tmp_chroot/etc/");
+ sudo($config, '--cp', "/etc/resolv.conf", "$tmp_chroot/etc/");
# install chroot
my $urpmi = $run->{urpmi};
@@ -423,32 +423,32 @@ sub build_chroot {
}
# remove files used by --urpmi-root
- sudo($run, $config, "--rm", "$tmp_chroot/etc/urpmi/urpmi.cfg");
- sudo($run, $config, "--rm", "$tmp_chroot/var/lib/urpmi/*");
+ sudo($config, "--rm", "$tmp_chroot/etc/urpmi/urpmi.cfg");
+ sudo($config, "--rm", "$tmp_chroot/var/lib/urpmi/*");
system("rpm -qa --root $tmp_chroot --qf '\%{NAME}-\%{VERSION}-\%{RELEASE}.\%{ARCH}\n' | sort > $tmp_chroot/tmp/qa");
- sudo($run, $config, "--cp", "$tmp_chroot/tmp/qa", "$tmp_chroot/var/log/qa");
+ sudo($config, "--cp", "$tmp_chroot/tmp/qa", "$tmp_chroot/var/log/qa");
unlink("$tmp_chroot/tmp/qa");
- sudo($run, $config, "--mkdir", "$tmp_chroot/etc/skel/rpm/$_")
+ sudo($config, "--mkdir", "$tmp_chroot/etc/skel/rpm/$_")
foreach "", qw(RPMS BUILD SPECS SRPMS SOURCES tmp);
#
# CM: Choose a sub-500 uid to prevent collison with $luser
#
- sudo($run, $config, "--useradd", $tmp_chroot, 'builder', 499);
+ sudo($config, "--useradd", $tmp_chroot, 'builder', 499);
# FIXME: <mrl> Be careful! Damn ugly hack right below!
- sudo($run, $config, "--rm", "$tmp_chroot/var/lib/rpm/__db*");
- sudo($run, $config, "--umount", "$tmp_chroot/proc");
- sudo($run, $config, "--umount", "$tmp_chroot/dev/pts");
+ sudo($config, "--rm", "$tmp_chroot/var/lib/rpm/__db*");
+ sudo($config, "--umount", "$tmp_chroot/proc");
+ sudo($config, "--umount", "$tmp_chroot/dev/pts");
if ($run->{icecream}) {
- sudo($run, $config, "--umount", "$tmp_chroot/var/cache/icecream");
+ sudo($config, "--umount", "$tmp_chroot/var/cache/icecream");
}
if (-d "$tmp_chroot/urpmi_medias/") {
- sudo($run, $config, "--umount", "$tmp_chroot/urpmi_medias");
+ sudo($config, "--umount", "$tmp_chroot/urpmi_medias");
}
- return sudo($run, $config, "--tar", $chroot_tar, $tmp_chroot);
+ return sudo($config, "--tar", $chroot_tar, $tmp_chroot);
}
sub check_build_chroot {
@@ -467,7 +467,7 @@ sub check_chroot {
if (time -$stat[9] > 604800) {
plog('WARN', "chroot tarball too old, force rebuild");
- sudo($run, $config, '--rm', '-r', $chroot, $chroot_tar);
+ sudo($config, '--rm', '-r', $chroot, $chroot_tar);
}
create_chroot($chroot, $chroot_tar, $run, $config, $opt);
}
diff --git a/lib/Iurt/DKMS.pm b/lib/Iurt/DKMS.pm
index d5613e8..481da46 100644
--- a/lib/Iurt/DKMS.pm
+++ b/lib/Iurt/DKMS.pm
@@ -281,7 +281,7 @@ sub dkms_compile {
my $rpms = "$chroot_tmp$_/*.rpm";
if (system("cp $rpms $dkms_spool/$media/ &>/dev/null") == 0) {
$copied = 1;
- sudo($run, $config, '--rm', $rpms)
+ sudo($config, '--rm', $rpms)
or plog('ERROR', "ERROR: could not delete dkms packages from $rpms ($!)");
last;
}
@@ -334,7 +334,7 @@ sub process_dkms_queue {
#should not be necessary
}
# should not be necessary to use sudo
- sudo($run, $config, '--rm', "$dir/$rpm");
+ sudo($config, '--rm', "$dir/$rpm");
$cache->{queue}{$srpm} = 1;
}
closedir $rpmdir;
diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm
index 90c16df..accd636 100644
--- a/lib/Iurt/Process.pm
+++ b/lib/Iurt/Process.pm
@@ -352,7 +352,7 @@ sub kill_for_good {
}
sub sudo {
- my ($_run, $config, @arg) = @_;
+ my ($config, @arg) = @_;
#plog("Running $config->{iurt_root_command} @arg");
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index 5ef407e..0556ce0 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -612,7 +612,7 @@ sub recreate_srpm {
perform_command([
sub {
my ($s, $d) = @_;
- sudo($run, $config, '--cp', $s, $d) } , [ "$dir/$srpm", "$chroot_tmp/home/$luser/rpm/SRPMS/" ] ],
+ sudo($config, '--cp', $s, $d) } , [ "$dir/$srpm", "$chroot_tmp/home/$luser/rpm/SRPMS/" ] ],
$run, $config, $cache,
type => 'perl',
mail => $config->{admin},
@@ -699,9 +699,9 @@ sub recreate_srpm {
my $newfile = "$chroot_tmp/home/$luser/rpm/SRPMS/$prefix$new_srpm";
if (-f $file && $newfile ne $file) {
if (-f $newfile) {
- sudo($run, $config, '--rm', $newfile) or die "$program_name: could not delete $newfile ($!)";
+ sudo($config, '--rm', $newfile) or die "$program_name: could not delete $newfile ($!)";
}
- sudo($run, $config, '--ln', $file, $newfile) or die "$program_name: linking $file to $newfile failed ($!)";
+ sudo($config, '--ln', $file, $newfile) or die "$program_name: linking $file to $newfile failed ($!)";
unlink $file;
unlink $oldsrpm if $oldsrpm ne $newfile;
}