diff options
author | Sebastian Luther <SebastianLuther@gmx.de> | 2011-01-31 13:45:43 +0100 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-01-31 13:03:14 -0800 |
commit | 9a58a3c8a4b6d6c92fac1250379cc97e1c8070d3 (patch) | |
tree | a4017635269fb0230ff0bb46b96ef70e86761760 /pym/portage | |
parent | 2a2b9e6485950757c59a1d5aa026d7f875311def (diff) | |
download | portage-9a58a3c8a4b6d6c92fac1250379cc97e1c8070d3.tar.gz portage-9a58a3c8a4b6d6c92fac1250379cc97e1c8070d3.tar.bz2 portage-9a58a3c8a4b6d6c92fac1250379cc97e1c8070d3.zip |
slot collision suggestions: Avoid showing redundant suggestions.
http://forums.gentoo.org/viewtopic-t-862257.html?sid=9ba8646a15044fe024a41154df351c6a
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/tests/resolver/ResolverPlayground.py | 16 | ||||
-rw-r--r-- | pym/portage/tests/resolver/test_slot_collisions.py | 18 |
2 files changed, 23 insertions, 11 deletions
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index a2b715128..eb591bba5 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -581,17 +581,11 @@ class ResolverPlaygroundResult(object): self.slot_collision_solutions = [] handler = self.depgraph._dynamic_config._slot_conflict_handler - for solution in handler.solutions: - s = {} - for pkg in solution: - changes = {} - for flag, state in solution[pkg].items(): - if state == "enabled": - changes[flag] = True - else: - changes[flag] = False - s[pkg.cpv] = changes - self.slot_collision_solutions.append(s) + for change in handler.changes: + new_change = {} + for pkg in change: + new_change[pkg.cpv] = change[pkg] + self.slot_collision_solutions.append(new_change) if self.depgraph._dynamic_config._circular_dependency_handler is not None: handler = self.depgraph._dynamic_config._circular_dependency_handler diff --git a/pym/portage/tests/resolver/test_slot_collisions.py b/pym/portage/tests/resolver/test_slot_collisions.py index 6f61c6c31..4c6a272d2 100644 --- a/pym/portage/tests/resolver/test_slot_collisions.py +++ b/pym/portage/tests/resolver/test_slot_collisions.py @@ -27,6 +27,10 @@ class SlotCollisionTestCase(TestCase): "sci-libs/L-1": { "DEPEND": "sci-libs/K[-foo]", "EAPI": 2 }, "sci-libs/M-1": { "DEPEND": "sci-libs/K[foo=]", "IUSE": "+foo", "EAPI": 2 }, + "sci-libs/Q-1": { "SLOT": "1", "IUSE": "+bar foo", "EAPI": 1 }, + "sci-libs/Q-2": { "SLOT": "2", "IUSE": "+bar +foo", "EAPI": 2, "PDEPEND": "sci-libs/Q:1[bar?,foo?]" }, + "sci-libs/P-1": { "DEPEND": "sci-libs/Q:1[foo=]", "IUSE": "foo", "EAPI": 2 }, + "app-misc/A-1": { "IUSE": "foo +bar", "REQUIRED_USE": "^^ ( foo bar )", "EAPI": "4" }, "app-misc/B-1": { "DEPEND": "=app-misc/A-1[foo=]", "IUSE": "foo", "EAPI": 2 }, "app-misc/C-1": { "DEPEND": "=app-misc/A-1[foo]", "EAPI": 2 }, @@ -42,6 +46,9 @@ class SlotCollisionTestCase(TestCase): "sci-libs/K-1": { "IUSE": "foo", "USE": "" }, "sci-libs/L-1": { "DEPEND": "sci-libs/K[-foo]" }, + "sci-libs/Q-1": { "SLOT": "1", "IUSE": "+bar +foo", "USE": "bar foo", "EAPI": 1 }, + "sci-libs/Q-2": { "SLOT": "2", "IUSE": "+bar +foo", "USE": "bar foo", "EAPI": 2, "PDEPEND": "sci-libs/Q:1[bar?,foo?]" }, + "app-misc/A-1": { "IUSE": "+foo bar", "USE": "foo", "REQUIRED_USE": "^^ ( foo bar )", "EAPI": "4" }, } @@ -87,6 +94,17 @@ class SlotCollisionTestCase(TestCase): slot_collision_solutions = [{"sci-libs/K-1": {"foo": False}, "sci-libs/M-1": {"foo": False}}] ), + #Avoid dupliacates. + ResolverPlaygroundTestCase( + ["sci-libs/P", "sci-libs/Q:2"], + success = False, + options = { "--update": True, "--complete-graph": True }, + mergelist = ["sci-libs/P-1", "sci-libs/Q-1"], + ignore_mergelist_order = True, + all_permutations=True, + slot_collision_solutions = [{"sci-libs/Q-1": {"foo": True}, "sci-libs/P-1": {"foo": True}}] + ), + #Conflict with REQUIRED_USE ResolverPlaygroundTestCase( ["=app-misc/C-1", "=app-misc/B-1"], |