aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--NEWS4
-rw-r--r--URPM/Resolve.pm10
2 files changed, 14 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 579ddf5..613d3b7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
- fix sorting choices on provided version (feature introduced in 3.08,
but was not working if packages were coming from different repository)
+- when a "Requires:" can be fullfilled by several different packages and
+ one of those packages is explicitly required by another package which
+ is also being installed, silently choose this package instead of letting
+ the choice up to perl-URPM user (fixes bug #46874)
Version 3.23 - 12 December 2008, by Pascal "Pixel" Rigaux
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;