diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-10-03 06:45:58 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-10-03 06:45:58 +0000 |
commit | d7a49d2705ee9ce532e8fd30c897695052b9c053 (patch) | |
tree | 833f78285766b95adc257fb542df2d5900416346 | |
parent | 4bb8224fb99072158a3d181754f57e02fcc27fce (diff) | |
download | portage-d7a49d2705ee9ce532e8fd30c897695052b9c053.tar.gz portage-d7a49d2705ee9ce532e8fd30c897695052b9c053.tar.bz2 portage-d7a49d2705ee9ce532e8fd30c897695052b9c053.zip |
Refector depgraph.altlist() reverse/ignore_priority handling.
svn path=/main/trunk/; revision=4578
-rwxr-xr-x | bin/emerge | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/bin/emerge b/bin/emerge index a232744cd..c543913b2 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1255,25 +1255,15 @@ class depgraph: def altlist(self, reversed=False): mygraph=self.digraph.copy() retlist=[] + if reversed: + get_nodes = mygraph.root_nodes + else: + get_nodes = mygraph.leaf_nodes while not mygraph.empty(): - ignore_priority = -1 - if reversed: - nodes = mygraph.root_nodes() - if not nodes: - ignore_priority = digraph.SOFT - nodes = mygraph.root_nodes(ignore_priority=digraph.SOFT) - if not nodes: - ignore_priority = digraph.MEDIUM - nodes = mygraph.root_nodes(ignore_priority=digraph.MEDIUM) - else: - nodes = mygraph.leaf_nodes() - if not nodes: - ignore_priority = digraph.SOFT - nodes = mygraph.leaf_nodes(ignore_priority=digraph.SOFT) - if not nodes: - ignore_priority = digraph.MEDIUM - nodes = mygraph.leaf_nodes(ignore_priority=digraph.MEDIUM) - + for ignore_priority in (-1, digraph.SOFT, digraph.MEDIUM): + nodes = get_nodes(ignore_priority=ignore_priority) + if nodes: + break selected_nodes = None if nodes: if ignore_priority <= digraph.SOFT: |