aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-09-05 10:45:35 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-09-05 13:06:39 +0100
commitf0b3612deba75050ce4ffee7d66488f544f48547 (patch)
tree44deaf7c48515f5930703c174ca9cf1af72d05c3
parent250deadc07a75f192ffbfc763f6238ed1ffaaf1a (diff)
downloadpaludis-f0b3612deba75050ce4ffee7d66488f544f48547.tar.gz
paludis-f0b3612deba75050ce4ffee7d66488f544f48547.tar.xz
_already_met only needs a PackageOrBlockDepSpec
-rw-r--r--paludis/resolver/decider.cc15
-rw-r--r--paludis/resolver/decider.hh2
2 files changed, 7 insertions, 10 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index a4d24a4..cc847b2 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1179,7 +1179,7 @@ Decider::_add_dependencies_if_necessary(
}
const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
- package_id, changed_choices, our_resolution->resolvent(), *s, _already_met(*s)));
+ package_id, changed_choices, our_resolution->resolvent(), *s, _already_met(s->spec())));
std::shared_ptr<const Resolvents> resolvents;
@@ -1340,7 +1340,7 @@ Decider::find_any_score(
}
const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
- our_id, make_null_shared_ptr(), our_resolution->resolvent(), dep, _already_met(dep)));
+ our_id, make_null_shared_ptr(), our_resolution->resolvent(), dep, _already_met(dep.spec())));
const std::shared_ptr<const Resolvents> resolvents(_get_resolvents_for(spec, reason));
/* next: will already be installing */
@@ -2086,19 +2086,16 @@ Decider::resolve()
}
bool
-Decider::_already_met(const SanitisedDependency & dep) const
+Decider::_already_met(const PackageOrBlockDepSpec & spec) const
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(dep.spec().if_package() ?
- *dep.spec().if_package() :
- dep.spec().if_block()->blocking(),
- { }) |
+ generator::Matches(spec.if_package() ? *spec.if_package() : spec.if_block()->blocking(), { }) |
filter::InstalledAtSlash())]);
if (installed_ids->empty())
- return bool(dep.spec().if_block());
+ return bool(spec.if_block());
else
{
- if (dep.spec().if_block())
+ if (spec.if_block())
return false;
if (installed_ids->end() == std::find_if(installed_ids->begin(), installed_ids->end(),
diff --git a/paludis/resolver/decider.hh b/paludis/resolver/decider.hh
index d98a706..e1ba60a 100644
--- a/paludis/resolver/decider.hh
+++ b/paludis/resolver/decider.hh
@@ -240,7 +240,7 @@ namespace paludis
const std::shared_ptr<const PackageID> &,
const bool existing) const;
- bool _already_met(const SanitisedDependency &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool _already_met(const PackageOrBlockDepSpec &) const PALUDIS_ATTRIBUTE((warn_unused_result));
bool _installed_but_allowed_to_remove(
const std::shared_ptr<const Resolution> &) const PALUDIS_ATTRIBUTE((warn_unused_result));