Exploid ascending order returned from dbapi.match() calls to avoid the need
authorZac Medico <zmedico@gentoo.org>
Tue, 1 Apr 2008 18:08:06 +0000 (18:08 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 1 Apr 2008 18:08:06 +0000 (18:08 -0000)
to call best().

svn path=/main/trunk/; revision=9665

pym/portage/__init__.py

index 7364127b310a0143f542fdccceeff7aa8d2261ba..a853e067fe4d281102e00e8d28d7db22ba8a266d 100644 (file)
@@ -5378,8 +5378,9 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                all_available = True
                versions = {}
                for atom in atoms:
-                       avail_pkg = best(mydbapi.match(atom))
+                       avail_pkg = mydbapi.match(atom)
                        if avail_pkg:
+                               avail_pkg = avail_pkg[-1] # highest (ascending order)
                                avail_slot = "%s:%s" % (dep_getkey(atom),
                                        mydbapi.aux_get(avail_pkg, ["SLOT"])[0])
                        elif not avail_pkg:
@@ -5387,8 +5388,9 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                                if hasattr(mydbapi, "xmatch"):
                                        has_mask = bool(mydbapi.xmatch("match-all", atom))
                                if (selective or use_binaries or not has_mask):
-                                       avail_pkg = best(vardb.match(atom))
+                                       avail_pkg = vardb.match(atom)
                                        if avail_pkg:
+                                               avail_pkg = avail_pkg[-1] # highest (ascending order)
                                                avail_slot = "%s:%s" % (dep_getkey(atom),
                                                        vardb.aux_get(avail_pkg, ["SLOT"])[0])
                        if not avail_pkg: