For bug #189219, use pkgcmp() to sort versions in selected/protected/omitted unmerge...
authorZac Medico <zmedico@gentoo.org>
Fri, 17 Aug 2007 18:17:14 +0000 (18:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 17 Aug 2007 18:17:14 +0000 (18:17 -0000)
svn path=/main/trunk/; revision=7639

pym/emerge/__init__.py

index 53a7a99c927fa3eca6dc035ea692a177d9f2012d..e92df3627a801b247df18057bf24118097e17cfc 100644 (file)
@@ -4140,12 +4140,14 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
                        if "--quiet" not in myopts:
                                portage.writemsg_stdout((mytype + ": ").rjust(14), noiselevel=-1)
                        if pkgmap[x][mytype]:
-                               for mypkg in pkgmap[x][mytype]:
-                                       mysplit=portage.catpkgsplit(mypkg)
-                                       if mysplit[3]=="r0":
-                                               myversion=mysplit[2]
+                               sorted_pkgs = [portage.catpkgsplit(mypkg)[1:] \
+                                       for mypkg in pkgmap[x][mytype]]
+                               sorted_pkgs.sort(portage.pkgcmp)
+                               for pn, ver, rev in sorted_pkgs:
+                                       if rev == "r0":
+                                               myversion = ver
                                        else:
-                                               myversion=mysplit[2]+"-"+mysplit[3]
+                                               myversion = ver + "-" + rev
                                        if mytype=="selected":
                                                portage.writemsg_stdout(
                                                        colorize("UNMERGE_WARN", myversion + " "), noiselevel=-1)