diff options
author | Francois Pons <fpons@mandriva.com> | 2002-07-25 11:19:33 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-07-25 11:19:33 +0000 |
commit | 14b622549eb8340600db94b8ec4082b3c5ee272d (patch) | |
tree | e96e81fb1e46805c851653afc1900a6a87985384 /URPM/Resolve.pm | |
parent | a463ec0e1d236bcb6bd575e9a38ad7111959902f (diff) | |
download | perl-URPM-14b622549eb8340600db94b8ec4082b3c5ee272d.tar perl-URPM-14b622549eb8340600db94b8ec4082b3c5ee272d.tar.gz perl-URPM-14b622549eb8340600db94b8ec4082b3c5ee272d.tar.bz2 perl-URPM-14b622549eb8340600db94b8ec4082b3c5ee272d.tar.xz perl-URPM-14b622549eb8340600db94b8ec4082b3c5ee272d.zip |
0.50-6mdk
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r-- | URPM/Resolve.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 52075e8..d320cb5 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -146,16 +146,22 @@ sub resolve_requested { #- take the best package for each choices of same name. my $packages = $urpm->find_candidate_packages($dep); foreach (values %$packages) { - my $best; + my ($best_requested, $best); foreach (@$_) { - if ($best && $best != $_) { - exists $requested{$_->id} || exists $state->{selected}{$_->id} and $best = $_, last; + exists $state->{selected}{$_->id} and $best_requested = $_, last; + if ($best_requested || exists $requested{$_->id}) { + if ($best_requested && $best_requested != $_) { + $_->compare_pkg($best_requested) > 0 and $best_requested = $_; + } else { + $best_requested = $_; + } + } elsif ($best && $best != $_) { $_->compare_pkg($best) > 0 and $best = $_; } else { $best = $_; } } - $_ = $best; + $_ = $best_requested || $best; } if (keys(%$packages) > 1) { #- package should be prefered if one of their provides is referenced |