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)
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: