summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-26 08:40:41 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-26 08:40:41 +0000
commitbc63450711c847c367fc5c105c1488cb76e7b991 (patch)
treefe52f659373a4dc9ec5278d91f73ded8e682e186 /pym/_emerge
parentdbe8584ad36f01ef3fdb1ca4245d346c181f972e (diff)
downloadportage-bc63450711c847c367fc5c105c1488cb76e7b991.tar.gz
portage-bc63450711c847c367fc5c105c1488cb76e7b991.tar.bz2
portage-bc63450711c847c367fc5c105c1488cb76e7b991.zip
Remove recursion code from Scheduler._system_merge_started() since indirect
deps are checked when the corresponding parent is merged. svn path=/main/trunk/; revision=12715
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/__init__.py51
1 files changed, 13 insertions, 38 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 8b7c69e7c..0dd1070b2 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -10786,16 +10786,7 @@ class Scheduler(PollScheduler):
completed_tasks = self._completed_tasks
unsatisfied = self._unsatisfied_system_deps
- def ignore_non_runtime(priority):
- """
- Ignore non-runtime priorities
- """
- if isinstance(priority, DepPriority) and \
- (priority.runtime or priority.runtime_post):
- return False
- return True
-
- def ignore_satisfied_runtime(priority):
+ def ignore_non_runtime_or_satisfied(priority):
"""
Ignore non-runtime and satisfied runtime priorities.
"""
@@ -10805,35 +10796,19 @@ class Scheduler(PollScheduler):
return False
return True
- traversed = set()
- dep_stack = [pkg]
- while dep_stack:
- node = dep_stack.pop()
- if node in traversed:
+ # When checking for unsatisfied runtime deps, only check
+ # direct deps since indirect deps are checked when the
+ # corresponding parent is merged.
+ for child in graph.child_nodes(pkg,
+ ignore_priority=ignore_non_runtime_or_satisfied):
+ if not isinstance(child, Package) or \
+ child.operation == 'uninstall':
continue
- traversed.add(node)
-
- unsatisfied_runtime = set(graph.child_nodes(node,
- ignore_priority=ignore_satisfied_runtime))
- for child in graph.child_nodes(node,
- ignore_priority=ignore_non_runtime):
- if not isinstance(child, Package) or \
- child.operation == 'uninstall':
- continue
- if child is pkg:
- continue
- if child.operation == 'merge' and \
- child in completed_tasks:
- # When traversing children, only traverse completed
- # 'merge' nodes since those are the only ones that need
- # to be checked for unsatisfied runtime deps, and it's
- # normal for nodes that aren't yet complete to have
- # unsatisfied runtime deps.
- dep_stack.append(child)
- if child.operation == 'merge' and \
- child not in completed_tasks and \
- child in unsatisfied_runtime:
- unsatisfied.add(child)
+ if child is pkg:
+ continue
+ if child.operation == 'merge' and \
+ child not in completed_tasks:
+ unsatisfied.add(child)
def _merge_wait_exit_handler(self, task):
self._merge_wait_scheduled.remove(task)