aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Urpmi.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Iurt/Urpmi.pm')
-rw-r--r--lib/Iurt/Urpmi.pm33
1 files changed, 12 insertions, 21 deletions
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index a180f73..baa6b92 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -182,7 +182,6 @@ sub add_media__urpmi_root {
my ($self, $chroot, $media) = @_;
my $run = $self->{run};
my $config = $self->{config};
- my $cache = $run->{cache};
foreach my $m (@{$media || []}) {
my $url = $self->{distrib_url} . "/media/" . $m;
@@ -190,7 +189,7 @@ sub add_media__urpmi_root {
$name =~ s![/:]!_!g;
plog("adding media $name from $url with option --urpmi-root in chroot $chroot");
perform_command("urpmi-addmedia -v --urpmi-root $chroot $name $url --probe-synthesis",
- $run, $config, $cache,
+ $run, $config,
mail => $config->{admin},
timeout => 300,
use_iurt_root_command => 1,
@@ -207,12 +206,11 @@ sub add_media {
my ($self, $chroot, $regexp, $media) = @_;
my $run = $self->{run};
my $config = $self->{config};
- my $cache = $run->{cache};
plog("add chroot media: $run->{chrooted_media}");
if (!perform_command("chroot $chroot urpmi.addmedia $media",
- $run, $config, $cache,
+ $run, $config,
mail => $config->{admin},
timeout => 300,
freq => 1,
@@ -232,9 +230,8 @@ sub add_packages {
my ($self, $chroot, $_user, @packages) = @_;
my $run = $self->{run};
my $config = $self->{config};
- my $cache = $run->{cache};
if (!perform_command("$self->{urpmi_command} @packages",
- $run, $config, $cache,
+ $run, $config,
use_iurt_root_command => $self->{use_iurt_root_command},
timeout => 300,
freq => 1,
@@ -391,7 +388,7 @@ sub are_installed {
sub _install_callback {
- my ($run, $admin, $cache, $opt, $output, $pack_provide, $title) = @_;
+ my ($run, $admin, $opt, $output, $pack_provide, $title) = @_;
plog('DEBUG', "calling callback for $opt->{hash}");
# 20060614
@@ -440,7 +437,6 @@ sub install_packages {
my $run = $self->{run};
my $config = $self->{config};
- my $cache = $run->{cache};
my $program_name = $run->{program_name};
my $ok = 1;
my @to_install;
@@ -477,7 +473,7 @@ sub install_packages {
if (!perform_command(
join(' ', $self->{urpmi_command}, @options, @to_install),
- $run, $config, $cache,
+ $run, $config,
use_iurt_root_command => $self->{use_iurt_root_command},
error => $error,
logname => $log,
@@ -495,7 +491,7 @@ sub install_packages {
log => $log_spool,
callback => sub {
my ($opt, $output) = @_;
- _install_callback($run, $config->{admin}, $cache, $opt, $output, $pack_provide, $title);
+ _install_callback($run, $config->{admin}, $opt, $output, $pack_provide, $title);
},
)) {
plog('DEBUG', "urpmi command failed.");
@@ -531,25 +527,21 @@ sub clean_urpmi_process {
sub update_srpm {
my ($self, $dir, $rpm, $wrong_rpm) = @_;
my $run = $self->{run};
- my $cache = $run->{cache};
my ($arch) = $rpm =~ /([^\.]+)\.rpm$/ or return 0;
- my $srpm = $cache->{rpm_srpm}{$rpm};
if (!$srpm) {
my $hdr = RPM4::Header->new("$dir/$rpm");
$hdr or return 0;
$srpm = $hdr->queryformat('%{SOURCERPM}');
- $cache->{rpm_srpm}{$rpm} = $srpm;
}
- $srpm = fix_srpm_name($cache, $srpm, $rpm, $wrong_rpm);
+ $srpm = fix_srpm_name($srpm, $rpm, $wrong_rpm);
$arch, $srpm;
}
sub fix_srpm_name {
- my ($cache, $srpm, $rpm, $wrong_rpm) = @_;
+ my ($srpm, $rpm, $wrong_rpm) = @_;
my $old_srpm = $srpm;
if ($srpm =~ s/^lib64/lib/) {
push @$wrong_rpm, [ $old_srpm, $rpm ] if ref $wrong_rpm;
- $cache->{rpm_srpm}{$rpm} = $srpm;
}
$srpm;
}
@@ -559,7 +551,6 @@ sub recreate_srpm {
my ($_self, $run, $config, $chroot_tmp, $dir, $srpm, $luser, $b_retry) = @_;
# recreate a new srpm for buildarch condition in the spec file
my $program_name = $run->{program_name};
- my $cache = $run->{cache};
my $with_flags = $run->{with_flags};
plog('NOTIFY', "recreate srpm: $srpm");
@@ -568,9 +559,9 @@ sub recreate_srpm {
sub {
my ($s, $d) = @_;
sudo($config, '--cp', $s, $d) } , [ "$dir/$srpm", "$chroot_tmp/home/$luser/rpmbuild/SRPMS/" ] ],
- $run, $config, $cache,
+ $run, $config,
type => 'perl',
- mail => $config->{admin},
+ mail => $config->{admin},
error => "[REBUILD] cannot copy $srpm to $chroot_tmp",
debug_mail => $run->{debug},
hash => "copy_$srpm") or return;
@@ -596,7 +587,7 @@ sub recreate_srpm {
});
plog('DEBUG', "recreating src.rpm...");
if (!perform_command(qq(chroot $chroot_tmp su $luser -c "rpm -i /home/$luser/rpmbuild/SRPMS/$srpm"),
- $run, $config, $cache, %opt)) {
+ $run, $config, %opt)) {
plog("ERROR: chrooting failed (retry $opt{retry}") if $run->{debug};
if ($opt{retry}) {
return -1;
@@ -624,7 +615,7 @@ sub recreate_srpm {
# 20060515 This should not be necessairy any more if urpmi *.spec works, but it doesn't
#
my $ret = perform_command(qq(chroot $chroot_tmp su $luser -c "rpmbuild --nodeps -bs $with_flags /home/$luser/rpmbuild/SPECS/$spec"),
- $run, $config, $cache,
+ $run, $config,
use_iurt_root_command => 1,
mail => $config->{admin},
error => "[REBUILD] cannot create $srpm in $chroot_tmp",