summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-23 06:51:10 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-23 06:51:10 +0000
commit22f3323fca7b52db6f4cd7ede3ebfc04a6ec737f (patch)
tree17bb143e60416b54cdd2af36568308ccc82d6d01
parentf1f9f6511f698a68ff76b5f1e3ec90906426ab52 (diff)
downloadportage-22f3323fca7b52db6f4cd7ede3ebfc04a6ec737f.tar.gz
portage-22f3323fca7b52db6f4cd7ede3ebfc04a6ec737f.tar.bz2
portage-22f3323fca7b52db6f4cd7ede3ebfc04a6ec737f.zip
When displaying reverse dependencies in verbose --depclean/--prune output,
sort the parent packages by cpv. svn path=/main/trunk/; revision=12691
-rw-r--r--pym/_emerge/__init__.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 3b20718b1..f92a4eb61 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -13629,13 +13629,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)
@@ -13650,7 +13659,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: