aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Resolve.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-08-04 17:51:15 +0000
committerFrancois Pons <fpons@mandriva.com>2003-08-04 17:51:15 +0000
commitb26fea9e305277b2874e2c7118be8da1bcc4a2a9 (patch)
tree3f98252e8da32497d8e6a75f6acb2e611b4cb704 /URPM/Resolve.pm
parent9c6a22e3a10c2272ce987ba6bed7647c2f48d04c (diff)
downloadperl-URPM-b26fea9e305277b2874e2c7118be8da1bcc4a2a9.tar
perl-URPM-b26fea9e305277b2874e2c7118be8da1bcc4a2a9.tar.gz
perl-URPM-b26fea9e305277b2874e2c7118be8da1bcc4a2a9.tar.bz2
perl-URPM-b26fea9e305277b2874e2c7118be8da1bcc4a2a9.tar.xz
perl-URPM-b26fea9e305277b2874e2c7118be8da1bcc4a2a9.zip
0.92-4mdk
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r--URPM/Resolve.pm38
1 files changed, 27 insertions, 11 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index d1144dd..9d439a4 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -546,19 +546,14 @@ sub resolve_requested {
#- they must first be unselected.
$state->{rejected}{$p->fullname}{closure}{$pkg->fullname} ||= undef;
}
- #- examine rpm db too.
- $db->traverse_tag('whatprovides', [ $n ], sub {
+ #- examine rpm db too (but only according to packages name as a fix in rpm itself)
+ $db->traverse_tag('name', [ $n ], sub {
my ($p) = @_;
- my %provides;
-
- #- a provide obsoleted in not concerned by this theory.
- @provides{$p->provides_nosense} = ();
- delete @provides{$p->obsoletes_nosense};
- exists $provides{$n} or return;
+ #- without an operator, anything (with the same name) is matched.
+ #- with an operator, check with package EVR with the obsoletes EVR.
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;
+ $p->name eq $pkg->name && $p->fullname eq $pkg->fullname || $satisfied or return;
#- do not propagate now the broken dependencies as they are
#- computed later.
@@ -1115,7 +1110,28 @@ sub build_transaction_set {
%set and push @{$state->{transaction}}, \%set;
}
}
- } elsif (%{$state->{selected} || {}}) {
+
+ #- check transaction set has been correctly created,
+ #- possible error are other package removed which should not be the case.
+ if (keys(%{$state->{selected}}) == keys(%{$state->{transaction_state}{selected}}) &&
+ (grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } keys %{$state->{rejected}}) ==
+ (grep { $state->{transaction_state}{rejected}{$_}{removed} && !$state->{transaction_state}{rejected}{$_}{obsoleted} }
+ keys %{$state->{transaction_state}{rejected}})
+ ) {
+ foreach (keys(%{$state->{selected}})) {
+ exists $state->{transaction_state}{selected}{$_} and next;
+ $state->{transaction} = []; last;
+ }
+ foreach (grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } keys %{$state->{rejected}}) {
+ $state->{transaction_state}{rejected}{$_}{removed} &&
+ !$state->{transaction_state}{rejected}{$_}{obsoleted} and next;
+ $state->{transaction} = []; last;
+ }
+ }
+ }
+
+ #- fallback if something can be selected but nothing has been allowed in transaction list.
+ if (%{$state->{selected} || {}} && !@{$state->{transaction}}) {
push @{$state->{transaction}}, {
upgrade => [ keys %{$state->{selected}} ],
remove => [ grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} }