From 75689d1acf4efc1253f7ea9e12a9a2db687e67d5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 2 May 2008 20:30:01 +0000 Subject: [PATCH] When searching for a "sys-apps/portage" installation task, use match_pkgs() instead of sequential search. svn path=/main/trunk/; revision=10104 --- pym/_emerge/__init__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 303743f9e..b306f1085 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -3430,7 +3430,7 @@ class depgraph(object): complete = "complete" in self.myparams myblocker_parents = self._blocker_parents.copy() asap_nodes = [] - portage_node = None + def get_nodes(**kwargs): """ Returns leaf nodes excluding Uninstall instances @@ -3441,13 +3441,15 @@ class depgraph(object): node.operation != "uninstall"] # sys-apps/portage needs special treatment if ROOT="/" - for node in mygraph.order: - if isinstance(node, Package) and \ - "sys-apps/portage" == node.cp and \ - "/" == node.root: - portage_node = node - asap_nodes.append(node) - break + portage_node = self.mydbapi["/"].match_pkgs("sys-apps/portage") + if portage_node: + portage_node = portage_node[0] + else: + portage_node = None + if portage_node is not None and \ + (not mygraph.contains(portage_node) or \ + portage_node.operation == "nomerge"): + portage_node = None ignore_priority_soft_range = [None] ignore_priority_soft_range.extend( -- 2.26.2