From ecd5ec2c060f0cfeaf13965bba67aed31e2c9093 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 9 Jul 2011 17:51:06 -0700 Subject: [PATCH] slot_collision: be consistent with missing IUSE Special handling for missing IUSE that was introduced in commit 9a193d42032005396800eb30e550691513529c79 is also useful in one more spot. --- pym/_emerge/resolver/slot_collision.py | 21 ++++++++++++------- .../tests/resolver/test_slot_collisions.py | 18 ++++++++++++++++ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py index d43b8892d..00429976a 100644 --- a/pym/_emerge/resolver/slot_collision.py +++ b/pym/_emerge/resolver/slot_collision.py @@ -337,14 +337,21 @@ class slot_conflict_handler(object): #are fewer possible solutions. use = sub_type for ppkg, atom, other_pkg in parents: - parent_use = None - if isinstance(ppkg, Package): - parent_use = _pkg_use_enabled(ppkg) - violated_atom = atom.unevaluated_atom.violated_conditionals( \ - _pkg_use_enabled(other_pkg), other_pkg.iuse.is_valid_flag, - parent_use=parent_use) - if use in violated_atom.use.enabled.union(violated_atom.use.disabled): + missing_iuse = other_pkg.iuse.get_missing_iuse( + atom.unevaluated_atom.use.required) + if missing_iuse: unconditional_use_deps.add((ppkg, atom)) + else: + parent_use = None + if isinstance(ppkg, Package): + parent_use = _pkg_use_enabled(ppkg) + violated_atom = atom.unevaluated_atom.violated_conditionals( + _pkg_use_enabled(other_pkg), + other_pkg.iuse.is_valid_flag, + parent_use=parent_use) + if use in violated_atom.use.enabled or \ + use in violated_atom.use.disabled: + unconditional_use_deps.add((ppkg, atom)) # When USE flags are removed, it can be # essential to see all broken reverse # dependencies here, so don't omit any. diff --git a/pym/portage/tests/resolver/test_slot_collisions.py b/pym/portage/tests/resolver/test_slot_collisions.py index 5839a39c3..4867cea05 100644 --- a/pym/portage/tests/resolver/test_slot_collisions.py +++ b/pym/portage/tests/resolver/test_slot_collisions.py @@ -31,6 +31,15 @@ class SlotCollisionTestCase(TestCase): "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 }, + "sys-libs/A-1": { "RDEPEND": "foo? ( sys-libs/J[foo=] )", "IUSE": "+foo", "EAPI": "4" }, + "sys-libs/B-1": { "RDEPEND": "bar? ( sys-libs/J[bar=] )", "IUSE": "+bar", "EAPI": "4" }, + "sys-libs/C-1": { "RDEPEND": "sys-libs/J[bar]", "EAPI": "4" }, + "sys-libs/D-1": { "RDEPEND": "sys-libs/J[bar?]", "IUSE": "bar", "EAPI": "4" }, + "sys-libs/E-1": { "RDEPEND": "sys-libs/J[foo(+)?]", "IUSE": "+foo", "EAPI": "4" }, + "sys-libs/F-1": { "RDEPEND": "sys-libs/J[foo(+)]", "EAPI": "4" }, + "sys-libs/J-1": { "IUSE": "+foo", "EAPI": "4" }, + "sys-libs/J-2": { "IUSE": "+bar", "EAPI": "4" }, + "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 }, @@ -62,6 +71,15 @@ class SlotCollisionTestCase(TestCase): ignore_mergelist_order = True, slot_collision_solutions = [ {"dev-libs/A-1": {"foo": True}, "dev-libs/D-1": {"foo": True}} ]), + ResolverPlaygroundTestCase( + ["sys-libs/A", "sys-libs/B", "sys-libs/C", "sys-libs/D", "sys-libs/E", "sys-libs/F"], + options = { "--autounmask": 'n' }, + success = False, + ignore_mergelist_order = True, + slot_collision_solutions = [], + mergelist = ['sys-libs/J-2', 'sys-libs/J-1', 'sys-libs/A-1', 'sys-libs/B-1', 'sys-libs/C-1', 'sys-libs/D-1', 'sys-libs/E-1', 'sys-libs/F-1'], + ), + #A version based conflicts, nothing we can do. ResolverPlaygroundTestCase( ["=app-misc/X-1", "=app-misc/Y-1"], -- 2.26.2