summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-11-16 20:11:28 +0000
committerThierry Vignaud <tv@mageia.org>2012-11-16 20:11:28 +0000
commitb7b740b82f1f504e215dd48237ded85ba74217ca (patch)
tree159835127d99950c9435edb59c94473029d13ce1
parent3336a22db38bd534110b298e3c7bc28df4555d4c (diff)
downloadurpmi-b7b740b82f1f504e215dd48237ded85ba74217ca.tar
urpmi-b7b740b82f1f504e215dd48237ded85ba74217ca.tar.gz
urpmi-b7b740b82f1f504e215dd48237ded85ba74217ca.tar.bz2
urpmi-b7b740b82f1f504e215dd48237ded85ba74217ca.tar.xz
urpmi-b7b740b82f1f504e215dd48237ded85ba74217ca.zip
(_schedule_packages) fix installing delta rpms
broken for years (actually it _NEVER_ worked...)
-rw-r--r--NEWS3
-rw-r--r--urpm/install.pm9
2 files changed, 11 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index cd3abbec..8be29e11 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- library:
+ o fix installing delta rpms (it never worked before)
+
Version 7.10 - 17 October 2012, by Thierry Vignaud
- do not offer to remove DKMS modules for current kernel (mga#5092)
diff --git a/urpm/install.pm b/urpm/install.pm
index 67f97ecf..15f1127c 100644
--- a/urpm/install.pm
+++ b/urpm/install.pm
@@ -194,15 +194,22 @@ sub _schedule_packages {
foreach (keys %$mode) {
my $pkg = $urpm->{depslist}[$_];
$pkg->update_header($mode->{$_}, keep_all_tags => 1);
+ my $true_pkg;
if ($pkg->payload_format eq 'drpm') { #- handle deltarpms
my $true_rpm = urpm::sys::apply_delta_rpm($mode->{$_}, "$urpm->{cachedir}/rpms", $pkg);
if ($true_rpm) {
push @produced_deltas, ($mode->{$_} = $true_rpm); #- fix path
+ if (my ($id) = $urpm->parse_rpm($true_rpm)) {
+ $true_pkg = defined $id && $urpm->{depslist}[$id];
+ $mode->{$id} = $true_rpm;
+ } else {
+ $urpm->{error}("Failed to parse $true_pkg");
+ }
} else {
$urpm->{error}(N("unable to extract rpm from delta-rpm package %s", $mode->{$_}));
}
}
- if ($trans->add($pkg, update => $update,
+ if ($trans->add($true_pkg || $pkg, update => $update,
$options{excludepath} ? (excludepath => [ split /,/, $options{excludepath} ]) : ())) {
$urpm->{debug} and $urpm->{debug}(
sprintf('trans: scheduling %s of %s (id=%d, file=%s)',