aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-18 16:14:14 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-18 16:14:14 +0000
commitd08e53b8320807a33d8c6884808d47cea3e6bca5 (patch)
treef0e5dc8493395444315179eef68d19ebde13239f
parentaac3c8f4e85c25563a79891013fbc456427ef162 (diff)
downloadperl-URPM-d08e53b8320807a33d8c6884808d47cea3e6bca5.tar
perl-URPM-d08e53b8320807a33d8c6884808d47cea3e6bca5.tar.gz
perl-URPM-d08e53b8320807a33d8c6884808d47cea3e6bca5.tar.bz2
perl-URPM-d08e53b8320807a33d8c6884808d47cea3e6bca5.tar.xz
perl-URPM-d08e53b8320807a33d8c6884808d47cea3e6bca5.zip
0.91-4mdk
-rw-r--r--URPM/Resolve.pm33
-rw-r--r--perl-URPM.spec5
2 files changed, 24 insertions, 14 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 1de44e6..5e5df28 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -412,20 +412,11 @@ sub resolve_requested {
if ($pkg->flag_installed && !$pkg->flag_upgrade) {
my $allow;
#- the same or a more recent package is installed,
- #- but this package may be required explicitely, in such
- #- case we can ask to remove all the previous one and
- #- choose this one to install.
$db->traverse_tag('name', [ $pkg->name ], sub {
my ($p) = @_;
- if ($pkg->compare_pkg($p) < 0) {
- $allow = ++$state->{oldpackage};
- #- avoid recusive rejects, else everything may be removed.
- my $rv = $state->{rejected}{$p->fullname} ||= {};
- $rv->{closure}{$pkg->fullname} = { old_requested => 1 };
- $rv->{removed} = 1;
- }
+ $allow ||= $pkg->compare_pkg($p) < 0;
});
- #- if nothing has been removed, just ignore it.
+ #- if nothing has been found, just ignore it.
$allow or next;
}
}
@@ -466,15 +457,31 @@ sub resolve_requested {
#- examine rpm db too.
$db->traverse_tag('whatprovides', [ $n ], sub {
my ($p) = @_;
- !$o || eval($p->compare($v) . $o . 0) or return;
+ my $satisfied = !$o || eval($p->compare($v) . $o . 0);
+
+ $n eq $p->name && $p->name eq $pkg->name && $p->fullname ne $pkg->fullname ||
+ $satisfied or return;
#- do not propagate now the broken dependencies as they are
#- computed later.
my $rv = $state->{rejected}{$p->fullname} ||= {};
$rv->{closure}{$pkg->fullname} = undef;
- $rv->{obsoleted} = 1;
$rv->{size} = $p->size;
+ if ($p->name eq $pkg->name) {
+ #- all packages older than the current one are obsoleted,
+ #- the others are simply removed (the result is the same).
+ if ($satisfied) {
+ $rv->{obsoleted} = 1;
+ } else {
+ $rv->{closure}{$pkg->fullname} = { old_requested => 1 };
+ $rv->{removed} = 1;
+ ++$state->{oldpackage};
+ }
+ } else {
+ $rv->{obsoleted} = 1;
+ }
+
foreach ($p->provides) {
#- check differential provides between obsoleted package and newer one.
if (my ($pn, $ps) = /^([^\s\[]*)(?:\[\*\])?\[?([^\s\]]*\s*[^\s\]]*)/) {
diff --git a/perl-URPM.spec b/perl-URPM.spec
index 0f69a68..037586e 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.91
-%define release 3mdk
+%define release 4mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -51,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Wed Jun 18 2003 François Pons <fpons@mandrakesoft.com> 0.91-4mdk
+- fixed installation of old package due to missing closure.
+
* Wed Jun 18 2003 François Pons <fpons@mandrakesoft.com> 0.91-3mdk
- fixed obssoletes on virtual provides not taken into account.
- fixed option name given to URPM::build_transaction_set.