depgraph: trigger rebuild for unbuilt child
authorZac Medico <zmedico@gentoo.org>
Fri, 26 Oct 2012 06:06:17 +0000 (23:06 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 26 Oct 2012 06:06:17 +0000 (23:06 -0700)
This will fix bug #439694, where built slot-operator deps failed
to trigger rebuilds if the deps were initially broken.

pym/_emerge/depgraph.py
pym/portage/tests/resolver/test_slot_operator_unsatisfied.py

index 41bdc8ecd21823015a30d54bb9d2dc5b4f174d9a..e129a810d94f8b08fc958fffe7a5780285a3468c 100644 (file)
@@ -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)
 
index 14631eb4eeab9139415ea71e8e0b647dead92e54..e3b53d159d027d3f2f4cd9df7168ae44946a096c 100644 (file)
@@ -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},