From 18376646e10f3ee72a75287d851f9e8815e94956 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 3 Feb 2009 00:27:49 +0000 Subject: [PATCH] Use portage.util.cmp_sort_key for python-3.0 compatibility. svn path=/main/trunk/; revision=12574 --- pym/_emerge/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 982ea6de4..5cb43bfe8 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -51,7 +51,7 @@ import portage.exception from portage.data import secpass from portage.elog.messages import eerror from portage.util import normalize_path as normpath -from portage.util import writemsg, writemsg_level +from portage.util import cmp_sort_key, writemsg, writemsg_level from portage.sets import load_default_config, SETPREFIX from portage.sets.base import InternalPackageSet @@ -6679,7 +6679,7 @@ class depgraph(object): node_info[node] = len(mygraph.parent_nodes(node)) def cmp_merge_preference(node1, node2): return node_info[node2] - node_info[node1] - mygraph.order.sort(cmp_merge_preference) + mygraph.order.sort(key=cmp_sort_key(cmp_merge_preference)) def altlist(self, reversed=False): @@ -7020,7 +7020,7 @@ class depgraph(object): if selected_nodes and len(selected_nodes) > 1: if not isinstance(selected_nodes, list): selected_nodes = list(selected_nodes) - selected_nodes.sort(cmp_circular_bias) + selected_nodes.sort(key=cmp_sort_key(cmp_circular_bias)) if not selected_nodes and not myblocker_uninstalls.is_empty(): # An Uninstall task needs to be executed in order to @@ -11670,7 +11670,7 @@ def unmerge(root_config, myopts, unmerge_action, writemsg_level((mytype + ": ").rjust(14), noiselevel=-1) if pkgmap[x][mytype]: sorted_pkgs = [portage.catpkgsplit(mypkg)[1:] for mypkg in pkgmap[x][mytype]] - sorted_pkgs.sort(portage.pkgcmp) + sorted_pkgs.sort(key=cmp_sort_key(portage.pkgcmp)) for pn, ver, rev in sorted_pkgs: if rev == "r0": myversion = ver @@ -12983,7 +12983,7 @@ def action_info(settings, trees, myopts, myfiles): if portage.isvalidatom(x): pkg_matches = trees["/"]["vartree"].dbapi.match(x) pkg_matches = [portage.catpkgsplit(cpv)[1:] for cpv in pkg_matches] - pkg_matches.sort(portage.pkgcmp) + pkg_matches.sort(key=cmp_sort_key(portage.pkgcmp)) pkgs = [] for pn, ver, rev in pkg_matches: if rev != "r0": @@ -13710,7 +13710,7 @@ def action_depclean(settings, trees, ldpath_mtimes, node_refcounts[node] = len(graph.parent_nodes(node)) def cmp_reference_count(node1, node2): return node_refcounts[node1] - node_refcounts[node2] - graph.order.sort(cmp_reference_count) + graph.order.sort(key=cmp_sort_key(cmp_reference_count)) ignore_priority_range = [None] ignore_priority_range.extend( -- 2.26.2