In cpv_expand(), if the virtuals file contains a versioned atom (like
authorZac Medico <zmedico@gentoo.org>
Thu, 3 Apr 2008 01:18:35 +0000 (01:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 3 Apr 2008 01:18:35 +0000 (01:18 -0000)
the base profile currently has for virtual/pam), properly remove the
operator and version from the atom before it is passed into
dbapi.cp_list(). (trunk r9683)

svn path=/main/branches/2.1.2/; revision=9684

pym/portage.py

index 30b1e2b19ed50fc5768e8b962609db44584f3b2d..56c4dab12efafa4be3811a306be853d4a2f846bf 100644 (file)
@@ -5655,7 +5655,11 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
                                        writemsg("virts[%s]: %s\n" % (str(mykey),virts[mykey]), 1)
                                        mykey_orig = mykey[:]
                                        for vkey in virts[mykey]:
-                                               if mydb.cp_list(vkey,use_cache=use_cache):
+                                               # The virtuals file can contain a versioned atom, so
+                                               # it may be necessary to remove the operator and
+                                               # version from the atom before it is passed into
+                                               # dbapi.cp_list().
+                                               if mydb.cp_list(dep_getkey(vkey), use_cache=use_cache):
                                                        mykey = vkey
                                                        writemsg("virts chosen: %s\n" % (mykey), 1)
                                                        break