From: Zac Medico Date: Tue, 30 Jun 2009 23:22:52 +0000 (-0000) Subject: Always use dep_getkey() when using profile virtuals values, since at least X-Git-Tag: v2.2_rc34~111 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c6397ea17d3b62ca07b2980b921170fff0cb361;p=portage.git Always use dep_getkey() when using profile virtuals values, since at least /profiles/base/virtuals contains an atom with an operator (virtual/pam maps to >=sys-libs/pam-0.78). svn path=/main/trunk/; revision=13750 --- diff --git a/pym/_emerge/create_world_atom.py b/pym/_emerge/create_world_atom.py index 715988f00..b2e7d151d 100644 --- a/pym/_emerge/create_world_atom.py +++ b/pym/_emerge/create_world_atom.py @@ -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 diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 0d095149c..69b8fda11 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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)