Fix Scheduler._find_system_deps() so that it only traverses runtime deps.
authorZac Medico <zmedico@gentoo.org>
Wed, 4 Feb 2009 04:51:33 +0000 (04:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 4 Feb 2009 04:51:33 +0000 (04:51 -0000)
svn path=/main/trunk/; revision=12581

pym/_emerge/__init__.py

index 4bd26824404739ba38954af2f033175c5cde32d6..b780958328f87c249844e3cc396fc929e471c22a 100644 (file)
@@ -9991,14 +9991,21 @@ class Scheduler(PollScheduler):
                        if system_set.findAtomForPackage(node):
                                node_stack.append(node)
 
+               def ignore_priority(priority):
+                       """
+                       Ignore non-runtime priorities.
+                       """
+                       if isinstance(priority, DepPriority) and \
+                               (priority.runtime or priority.runtime_post):
+                               return False
+                       return True
+
                while node_stack:
                        node = node_stack.pop()
                        if node in deep_system_deps:
                                continue
                        deep_system_deps.add(node)
-                       # TODO: Only traverse runtime deps since we aren't concerned about
-                       # buildtime deps here.
-                       for child in graph.child_nodes(node):
+                       for child in graph.child_nodes(node, ignore_priority=ignore_priority):
                                if not isinstance(child, Package) or \
                                        child.operation == "uninstall":
                                        continue