Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12715 - main/trunk/pym/_emerge
Date: Thu, 26 Feb 2009 08:40:50
Message-Id: E1LcbnO-0000sJ-IH@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-02-26 08:40:41 +0000 (Thu, 26 Feb 2009)
3 New Revision: 12715
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Remove recursion code from Scheduler._system_merge_started() since indirect
9 deps are checked when the corresponding parent is merged.
10
11
12 Modified: main/trunk/pym/_emerge/__init__.py
13 ===================================================================
14 --- main/trunk/pym/_emerge/__init__.py 2009-02-26 07:50:49 UTC (rev 12714)
15 +++ main/trunk/pym/_emerge/__init__.py 2009-02-26 08:40:41 UTC (rev 12715)
16 @@ -10786,17 +10786,8 @@
17 completed_tasks = self._completed_tasks
18 unsatisfied = self._unsatisfied_system_deps
19
20 - def ignore_non_runtime(priority):
21 + def ignore_non_runtime_or_satisfied(priority):
22 """
23 - Ignore non-runtime priorities
24 - """
25 - if isinstance(priority, DepPriority) and \
26 - (priority.runtime or priority.runtime_post):
27 - return False
28 - return True
29 -
30 - def ignore_satisfied_runtime(priority):
31 - """
32 Ignore non-runtime and satisfied runtime priorities.
33 """
34 if isinstance(priority, DepPriority) and \
35 @@ -10805,36 +10796,20 @@
36 return False
37 return True
38
39 - traversed = set()
40 - dep_stack = [pkg]
41 - while dep_stack:
42 - node = dep_stack.pop()
43 - if node in traversed:
44 + # When checking for unsatisfied runtime deps, only check
45 + # direct deps since indirect deps are checked when the
46 + # corresponding parent is merged.
47 + for child in graph.child_nodes(pkg,
48 + ignore_priority=ignore_non_runtime_or_satisfied):
49 + if not isinstance(child, Package) or \
50 + child.operation == 'uninstall':
51 continue
52 - traversed.add(node)
53 + if child is pkg:
54 + continue
55 + if child.operation == 'merge' and \
56 + child not in completed_tasks:
57 + unsatisfied.add(child)
58
59 - unsatisfied_runtime = set(graph.child_nodes(node,
60 - ignore_priority=ignore_satisfied_runtime))
61 - for child in graph.child_nodes(node,
62 - ignore_priority=ignore_non_runtime):
63 - if not isinstance(child, Package) or \
64 - child.operation == 'uninstall':
65 - continue
66 - if child is pkg:
67 - continue
68 - if child.operation == 'merge' and \
69 - child in completed_tasks:
70 - # When traversing children, only traverse completed
71 - # 'merge' nodes since those are the only ones that need
72 - # to be checked for unsatisfied runtime deps, and it's
73 - # normal for nodes that aren't yet complete to have
74 - # unsatisfied runtime deps.
75 - dep_stack.append(child)
76 - if child.operation == 'merge' and \
77 - child not in completed_tasks and \
78 - child in unsatisfied_runtime:
79 - unsatisfied.add(child)
80 -
81 def _merge_wait_exit_handler(self, task):
82 self._merge_wait_scheduled.remove(task)
83 self._merge_exit(task)