aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-01-08 09:24:23 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-01-08 09:24:23 +0000
commit5a244e0774978fa8bf0a7f27871e695b2d31b13a (patch)
tree0d22abdd32db1049576d72729d2489b94be94826 /URPM
parent1c77663e3060b51e30e68eaedbd1f842f4d23fbc (diff)
downloadperl-URPM-5a244e0774978fa8bf0a7f27871e695b2d31b13a.tar
perl-URPM-5a244e0774978fa8bf0a7f27871e695b2d31b13a.tar.gz
perl-URPM-5a244e0774978fa8bf0a7f27871e695b2d31b13a.tar.bz2
perl-URPM-5a244e0774978fa8bf0a7f27871e695b2d31b13a.tar.xz
perl-URPM-5a244e0774978fa8bf0a7f27871e695b2d31b13a.zip
Favour required packages when we have several choices to fulfill
a "requires", fixes bug #46874
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 4d634dd..3593c3b 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -240,6 +240,16 @@ sub find_required_package {
_set_flag_installed_and_upgrade_if_no_newer($db, $pkg);
}
+ #- if another package requires one of the potential candidates,
+ #- we select this candidate instead of keeping all the
+ #- other packages.
+ foreach my $pkg (@packages) {
+ exists $state->{whatrequires}->{$pkg->name} or next;
+ $urpm->{debug_URPM}("forcing use of " . $pkg->name . " for $id_prop because " . join(", ", map { $urpm->{depslist}[$_]->name } keys %{$state->{whatrequires}->{$pkg->name}}) . " require(s) it") if $urpm->{debug_URPM};
+
+ return [ $pkg ];
+ }
+
if (my @kernel_source = _find_required_package__kernel_source($urpm, $db, \@packages)) {
$urpm->{debug_URPM}("packageCallbackChoices: kernel source chosen " . join(",", map { $_->name } @kernel_source) . " in " . join(",", map { $_->name } @packages)) if $urpm->{debug_URPM};
return \@kernel_source, \@kernel_source;