summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-19 21:54:54 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-19 21:54:54 +0000
commitfed0b979944958a7744510b6d3b59d02a789ba53 (patch)
tree12ac04f4f2379f8d0a7634452d1c78f00fe6427d /pym
parent648ec0e0d68748ff2904c2672fa5ef1008d33c98 (diff)
downloadportage-fed0b979944958a7744510b6d3b59d02a789ba53.tar.gz
portage-fed0b979944958a7744510b6d3b59d02a789ba53.tar.bz2
portage-fed0b979944958a7744510b6d3b59d02a789ba53.zip
Use Atom.cp instead of dep_getkey.
svn path=/main/trunk/; revision=15401
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/depgraph.py11
-rw-r--r--pym/portage/__init__.py7
2 files changed, 9 insertions, 9 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9cb6ddf13..70b59dda2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1819,8 +1819,7 @@ class depgraph(object):
pprovided_match = False
for virt_choice in virtuals.get(atom.cp, []):
expanded_atom = portage.dep.Atom(
- atom.replace(atom.cp,
- portage.dep_getkey(virt_choice), 1))
+ atom.replace(atom.cp, virt_choice.cp, 1))
pprovided = pprovideddict.get(expanded_atom.cp)
if pprovided and \
portage.match_from_list(expanded_atom, pprovided):
@@ -3004,10 +3003,8 @@ class depgraph(object):
if provider_virtual:
atoms = []
for provider_entry in virtuals[blocker.cp]:
- provider_cp = \
- portage.dep_getkey(provider_entry)
atoms.append(Atom(blocker.atom.replace(
- blocker.cp, provider_cp)))
+ blocker.cp, provider_entry.cp, 1)))
else:
atoms = [blocker.atom]
@@ -5352,14 +5349,14 @@ class _dep_check_composite_db(portage.dbapi):
if len(expanded_atoms) > 1:
non_virtual_atoms = []
for x in expanded_atoms:
- if not portage.dep_getkey(x).startswith("virtual/"):
+ if not x.cp.startswith("virtual/"):
non_virtual_atoms.append(x)
if len(non_virtual_atoms) == 1:
expanded_atoms = non_virtual_atoms
if len(expanded_atoms) > 1:
# compatible with portage.cpv_expand()
raise portage.exception.AmbiguousPackageName(
- [portage.dep_getkey(x) for x in expanded_atoms])
+ [x.cp for x in expanded_atoms])
if expanded_atoms:
atom = expanded_atoms[0]
else:
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index f28c4216f..378537190 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3276,7 +3276,10 @@ class config(object):
modified = False
cp = dep.Atom(cpv_getkey(mycpv))
for virt in virts:
- virt = dep_getkey(virt)
+ try:
+ virt = dep.Atom(virt).cp
+ except exception.InvalidAtom:
+ continue
providers = self.virtuals.get(virt)
if providers and cp in providers:
continue
@@ -8532,7 +8535,7 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
# 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):
+ if mydb.cp_list(vkey.cp):
mykey = str(vkey)
writemsg(_("virts chosen: %s\n") % (mykey), 1)
break