aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-20 09:25:41 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-20 09:25:46 +0000
commit54fce48d95fe491f7541e1a834160eebd0e54f4f (patch)
tree30a453dd954099e86cc8000ba4cf822f351a21fb
parent9c4d2e118f1503bf0c3d14996c774d1ac51a7bbd (diff)
downloadpaludis-54fce48d95fe491f7541e1a834160eebd0e54f4f.tar.gz
paludis-54fce48d95fe491f7541e1a834160eebd0e54f4f.tar.xz
Care about installed suggestions if already taken
-rw-r--r--src/clients/cave/resolve_common.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 42fb39a..0c9723f 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -792,8 +792,18 @@ namespace
if (is_suggestion(dep) || is_recommendation(dep))
{
- /* should only return false if the dep's not already installedish */
- return false;
+ /* we only take a suggestion or recommendation for an existing
+ * package if it's already met. for now, we ignore suggested
+ * and recommended blocks no matter what. */
+ if (dep.spec().if_block())
+ return false;
+
+ const std::tr1::shared_ptr<const PackageIDSequence> installed_ids(
+ (*env)[selection::SomeArbitraryVersion(
+ generator::Matches(*dep.spec().if_package(), MatchPackageOptions()) |
+ filter::InstalledAtRoot(FSEntry("/")))]);
+ if (installed_ids->empty())
+ return false;
}
return true;