aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-08-14 22:15:16 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-08-14 22:15:16 +0100
commit84ace8b4ae6078d40c95fe1b5ad25fbec34e96fd (patch)
tree481c1136371ba0539d8c16a22052a5387a75bc21
parenta4b2347fe0fbfb312709670025e0ad27fec02ad9 (diff)
downloadpaludis-84ace8b4ae6078d40c95fe1b5ad25fbec34e96fd.tar.gz
paludis-84ace8b4ae6078d40c95fe1b5ad25fbec34e96fd.tar.xz
|| ( a[b] a[d] ) should pick [d] if it's already installed
-rw-r--r--paludis/resolver/resolver.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index e479a06..0b74dac 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -947,6 +947,16 @@ Resolver::find_any_score(const QPN_S & our_qpn_s, const SanitisedDependency & de
/* best: already installed */
{
const std::tr1::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
+ generator::Matches(spec, MatchPackageOptions()) |
+ filter::SupportsAction<InstalledAction>())]);
+ if (! installed_ids->empty())
+ return 50 + operator_bias;
+ }
+
+ /* next: already installed, except with the wrong options */
+ if (spec.additional_requirements_ptr())
+ {
+ const std::tr1::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
generator::Matches(spec, MatchPackageOptions() + mpo_ignore_additional_requirements) |
filter::SupportsAction<InstalledAction>())]);
if (! installed_ids->empty())