From: Zac Medico Date: Wed, 11 Mar 2009 06:14:17 +0000 (-0000) Subject: When displaying reverse dependencies in verbose --depclean/--prune output, X-Git-Tag: v2.1.6.8~128 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f5fe68e80abc8f7409ee8568211184901c1c302;p=portage.git When displaying reverse dependencies in verbose --depclean/--prune output, sort the parent packages by cpv. (trunk r12691) svn path=/main/branches/2.1.6/; revision=12949 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 32d07bc7a..1f1f2e7c0 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -13457,13 +13457,22 @@ def action_depclean(settings, trees, ldpath_mtimes, msg.append("\n") portage.writemsg_stdout("".join(msg), noiselevel=-1) + def cmp_pkg_cpv(pkg1, pkg2): + """Sort Package instances by cpv.""" + if pkg1.cpv > pkg2.cpv: + return 1 + elif pkg1.cpv == pkg2.cpv: + return 0 + else: + return -1 + def create_cleanlist(): pkgs_to_remove = [] if action == "depclean": if args_set: - for pkg in vardb: + for pkg in sorted(vardb, key=cmp_sort_key(cmp_pkg_cpv)): arg_atom = None try: arg_atom = args_set.findAtomForPackage(pkg) @@ -13478,7 +13487,7 @@ def action_depclean(settings, trees, ldpath_mtimes, show_parents(pkg) else: - for pkg in vardb: + for pkg in sorted(vardb, key=cmp_sort_key(cmp_pkg_cpv)): if pkg not in graph: pkgs_to_remove.append(pkg) elif "--verbose" in myopts: