From cbe52a133e4480cefd22ca51dd0c133c09eb93f4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 25 Oct 2012 23:06:17 -0700 Subject: [PATCH] depgraph: trigger rebuild for unbuilt child This will fix bug #439694, where built slot-operator deps failed to trigger rebuilds if the deps were initially broken. --- pym/_emerge/depgraph.py | 4 ++-- .../tests/resolver/test_slot_operator_unsatisfied.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 41bdc8ecd..e129a810d 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1192,7 +1192,7 @@ class depgraph(object): for slot_key, slot_info in self._dynamic_config._slot_operator_deps.items(): for dep in slot_info: - if not (dep.child.built and dep.parent and + if not (dep.parent and isinstance(dep.parent, Package) and dep.parent.built): continue @@ -1619,7 +1619,7 @@ class depgraph(object): not (deep is not True and depth > deep)) dep.child = pkg - if (not pkg.onlydeps and pkg.built and + if (not pkg.onlydeps and dep.atom and dep.atom.slot_operator_built): self._add_slot_operator_dep(dep) diff --git a/pym/portage/tests/resolver/test_slot_operator_unsatisfied.py b/pym/portage/tests/resolver/test_slot_operator_unsatisfied.py index 14631eb4e..e3b53d159 100644 --- a/pym/portage/tests/resolver/test_slot_operator_unsatisfied.py +++ b/pym/portage/tests/resolver/test_slot_operator_unsatisfied.py @@ -43,13 +43,16 @@ class SlotOperatorUnsatisfiedTestCase(TestCase): test_cases = ( # Demonstrate bug #439694, where a broken slot-operator - # sub-slot dependency fails to trigger rebuild. + # sub-slot dependency needs to trigger a rebuild. ResolverPlaygroundTestCase( ["@world"], options = {"--update": True, "--deep": True}, success = True, - mergelist = ["app-misc/A-1"]), + mergelist = ["app-misc/B-0"]), + # This doesn't trigger a rebuild, since there's no version + # change to trigger complete graph mode, and initially + # unsatisfied deps are ignored in complete graph mode anyway. ResolverPlaygroundTestCase( ["app-misc/A"], options = {"--oneshot": True}, -- 2.26.2