aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-12 22:13:31 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-12 22:13:31 +0100
commit5a5fec01d3b1dcaf46a025233e93bb71c435719f (patch)
tree71bd72b7ca6d8c551a1c11e4a98c0b2a70841e0f
parent71df668e7576418a296fc24f8063d99208df258b (diff)
downloadpaludis-5a5fec01d3b1dcaf46a025233e93bb71c435719f.tar.gz
paludis-5a5fec01d3b1dcaf46a025233e93bb71c435719f.tar.xz
ignore suggestions from installed things
-rw-r--r--src/clients/cave/cmd_resolve.cc31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index d47b12e..2928453 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -369,24 +369,29 @@ namespace
struct IsSuggestionVisitor
{
bool is_suggestion;
+ bool is_recommendation;
+ bool is_requirement;
IsSuggestionVisitor() :
- is_suggestion(true)
+ is_suggestion(false),
+ is_recommendation(false),
+ is_requirement(false)
{
}
void visit(const DependencyRequiredLabel &)
{
- is_suggestion = false;
+ is_requirement = true;
}
void visit(const DependencyRecommendedLabel &)
{
- is_suggestion = false;
+ is_recommendation = true;
}
void visit(const DependencySuggestedLabel &)
{
+ is_suggestion = true;
}
};
@@ -434,7 +439,19 @@ namespace
std::for_each(indirect_iterator(dep.active_dependency_labels()->suggest_labels()->begin()),
indirect_iterator(dep.active_dependency_labels()->suggest_labels()->end()),
accept_visitor(v));
- return v.is_suggestion;
+ return v.is_suggestion && (! v.is_recommendation) && (! v.is_requirement);
+ }
+
+ bool is_recommendation(const SanitisedDependency & dep)
+ {
+ if (dep.active_dependency_labels()->suggest_labels()->empty())
+ return false;
+
+ IsSuggestionVisitor v;
+ std::for_each(indirect_iterator(dep.active_dependency_labels()->suggest_labels()->begin()),
+ indirect_iterator(dep.active_dependency_labels()->suggest_labels()->end()),
+ accept_visitor(v));
+ return v.is_recommendation && (! v.is_requirement);
}
bool is_just_build_dep(const SanitisedDependency & dep)
@@ -473,6 +490,12 @@ namespace
if (cmdline.resolution_options.a_ignore_installed_dependencies.specified())
if (! is_compiled_against_dep(dep))
return false;
+
+ if (is_suggestion(dep) || is_recommendation(dep))
+ {
+ /* should only return false if the dep's not already installedish */
+ return false;
+ }
}
return true;