diff options
author | Francois Pons <fpons@mandriva.com> | 2003-07-30 16:57:01 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-07-30 16:57:01 +0000 |
commit | 39c2a3c746ca2e70d4884423ce3d5213607fd7ef (patch) | |
tree | c714507a76d447c7680c5a3028ee8d5cef79dcdb /URPM/Resolve.pm | |
parent | 47416e45572d660d1f97fa67b69bcd18234b7b86 (diff) | |
download | perl-URPM-39c2a3c746ca2e70d4884423ce3d5213607fd7ef.tar perl-URPM-39c2a3c746ca2e70d4884423ce3d5213607fd7ef.tar.gz perl-URPM-39c2a3c746ca2e70d4884423ce3d5213607fd7ef.tar.bz2 perl-URPM-39c2a3c746ca2e70d4884423ce3d5213607fd7ef.tar.xz perl-URPM-39c2a3c746ca2e70d4884423ce3d5213607fd7ef.zip |
fixed some missing unsatisfied in reason of rejected packages.
fixed provide obsoleted which should not be taken into account when looking for
obsoletes.
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r-- | URPM/Resolve.pm | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 0c18f31..d1144dd 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -331,7 +331,8 @@ sub resolve_rejected { my $rv = $state->{rejected}{$p->fullname} ||= {}; #- keep track of what cause closure. - $rv->{closure}{$pkg->fullname} = { unsatisfied => \@l }; + my %d; @d{@{$rv->{closure}{$pkg->fullname}{unsatisfied} ||= []}} = (); + push @{$rv->{closure}{$pkg->fullname}{unsatisfied}}, grep { ! exists $d{$_} } @l; #- set removed and obsoleted level. foreach (qw(removed obsoleted)) { @@ -548,8 +549,14 @@ sub resolve_requested { #- examine rpm db too. $db->traverse_tag('whatprovides', [ $n ], sub { my ($p) = @_; - my $satisfied = !$o || eval($p->compare($v) . $o . 0); + 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; + 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; @@ -595,10 +602,10 @@ sub resolve_requested { } #- all requires should be satisfied according to selected package, or installed packages. - push @properties, map { +{ required => $_, from => $pkg, - exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]}, - exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]}, - } } $urpm->unsatisfied_requires($db, $state, $pkg); + unshift @properties, map { +{ required => $_, from => $pkg, + exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]}, + exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]}, + } } $urpm->unsatisfied_requires($db, $state, $pkg); #- keep in mind what is requiring each item (for unselect to work). foreach ($pkg->requires_nosense) { @@ -646,7 +653,7 @@ sub resolve_requested { @{$packages->{$p->name}}; if (length $best) { - push @properties, { required => $best, promote_conflicts => $name, }; + unshift @properties, { required => $best, promote_conflicts => $name, }; } else { if ($options{keep}) { push @keep, scalar $p->fullname; |