Always use dep_getkey() when using profile virtuals values, since at least
authorZac Medico <zmedico@gentoo.org>
Tue, 30 Jun 2009 23:22:52 +0000 (23:22 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 30 Jun 2009 23:22:52 +0000 (23:22 -0000)
/profiles/base/virtuals contains an atom with an operator (virtual/pam maps
to >=sys-libs/pam-0.78).

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

pym/_emerge/create_world_atom.py
pym/portage/__init__.py

index 715988f00b459dbdce9a169c2f6c45650873d13e..b2e7d151dcaec0cf87832f8caccbc3a05abcebe6 100644 (file)
@@ -89,7 +89,8 @@ def create_world_atom(pkg, args_set, root_config):
                        # pulled in by update or depclean.
                        providers = portdb.mysettings.getvirtuals().get(
                                portage.dep_getkey(system_atom))
-                       if providers and len(providers) == 1 and providers[0] == cp:
+                       if providers and len(providers) == 1 and \
+                               portage.dep_getkey(providers[0]) == cp:
                                return None
        return new_world_atom
 
index 0d095149c04716a34599be15f02f5007e8b0401c..69b8fda119aa40f45c185176231899cf1288df51 100644 (file)
@@ -6848,7 +6848,7 @@ def dep_virtual(mysplit, mysettings):
                        mychoices = myvirtuals.get(mykey, None)
                        if mychoices:
                                if len(mychoices) == 1:
-                                       a = x.replace(mykey, mychoices[0])
+                                       a = x.replace(mykey, dep_getkey(mychoices[0]), 1)
                                else:
                                        if x[0]=="!":
                                                # blocker needs "and" not "or(||)".
@@ -6856,7 +6856,7 @@ def dep_virtual(mysplit, mysettings):
                                        else:
                                                a=['||']
                                        for y in mychoices:
-                                               a.append(x.replace(mykey, y))
+                                               a.append(x.replace(mykey, dep_getkey(y), 1))
                                newsplit.append(a)
                        else:
                                newsplit.append(x)
@@ -7017,7 +7017,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                                        a.append(portage.dep.Atom(x.replace(mykey, y, 1)))
                        else:
                                for y in mychoices:
-                                       new_atom = portage.dep.Atom(x.replace(mykey, y, 1))
+                                       new_atom = portage.dep.Atom(
+                                               x.replace(mykey, dep_getkey(y), 1))
                                        matches = portdb.match(new_atom)
                                        # portdb is an instance of depgraph._dep_check_composite_db, so
                                        # USE conditionals are already evaluated.
@@ -7028,7 +7029,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                if not a and not isblocker and mychoices:
                        # Check for a virtual package.provided match.
                        for y in mychoices:
-                               new_atom = portage.dep.Atom(x.replace(mykey, y, 1))
+                               new_atom = portage.dep.Atom(x.replace(mykey, dep_getkey(y), 1))
                                if match_from_list(new_atom,
                                        pprovideddict.get(new_atom.cp, [])):
                                        a.append(new_atom)