aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2009-04-02 22:06:26 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2009-04-02 22:06:26 +0100
commitd612cba0c98130dc3ffcad6eea506f5bfd2a8199 (patch)
tree350bbcdc3f1b89cf7a5570c1c20c330619672567
parent9eca1ca938d1db5e655ef3dde1f3148c34675358 (diff)
downloadpaludis-d612cba0c98130dc3ffcad6eea506f5bfd2a8199.tar.gz
paludis-d612cba0c98130dc3ffcad6eea506f5bfd2a8199.tar.xz
Don't throw a CircularDependencyError when foo depends on || ( foo-bin foo )
-rw-r--r--paludis/dep_list.cc10
-rw-r--r--paludis/dep_list_TEST.cc21
2 files changed, 29 insertions, 2 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index ff068fd..7a0b174 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -735,8 +735,14 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type
if (d->already_installed(**c, destinations))
{
Context context("When using already installed group to resolve dependencies:");
- d->add_not_top_level(only_if_not_suggested_label, **c, destinations);
- return;
+ try
+ {
+ d->add_not_top_level(only_if_not_suggested_label, **c, destinations);
+ return;
+ }
+ catch (const DepListError &)
+ {
+ }
}
}
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 0cfc0ef..668104a 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -1898,6 +1898,27 @@ namespace test_cases
} test_dep_list_79;
/**
+ * \test Test DepList resolution behaviour.
+ *
+ */
+ struct DepListTestCase80 : DepListTestCase<80>
+ {
+ void populate_repo()
+ {
+ repo->add_version("cat", "pkg-bin", "1");
+ std::tr1::shared_ptr<FakePackageID> catpkg(repo->add_version("cat", "pkg", "1"));
+ catpkg->build_dependencies_key()->set_from_string("|| ( cat/pkg-bin cat/pkg )");
+ }
+
+ void populate_expected()
+ {
+ merge_target = "cat/pkg";
+ expected.push_back("cat/pkg-bin-1:0::repo");
+ expected.push_back("cat/pkg-1:0::repo");
+ }
+ } test_dep_list_80;
+
+ /**
* \test Test DepList transactional add behaviour.
*
*/