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):
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]
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:
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
# 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