summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-09 18:03:27 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-09 18:03:27 -0700
commit57b3d395aa582e798f008240ebd635fd0f269bed (patch)
tree34ec9df8bf08c2be1a70d976c8ed3d7d67603bb3 /pym
parent2e530322dad9747cd85e7a1d9cf5326a99af4979 (diff)
downloadportage-57b3d395aa582e798f008240ebd635fd0f269bed.tar.gz
portage-57b3d395aa582e798f008240ebd635fd0f269bed.tar.bz2
portage-57b3d395aa582e798f008240ebd635fd0f269bed.zip
dep_check_composite_db: remove unused _dep_expand
This code has been unused since dep_check started passing token_class=Atom to use_reduce in commit c9f7930883d62fc26af72bff0c4623db0bbc8221. Since then, any atoms without categories are dropped by dep_check because it returns early after catching an InvalidDependString exception.
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/depgraph.py44
1 files changed, 1 insertions, 43 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 80a7d6c65..7b1940b5a 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6069,9 +6069,6 @@ class _dep_check_composite_db(dbapi):
ret = self._match_cache.get(atom)
if ret is not None:
return ret[:]
- orig_atom = atom
- if "/" not in atom:
- atom = self._dep_expand(atom)
pkg, existing = self._depgraph._select_package(self._root, atom)
if not pkg:
ret = []
@@ -6111,7 +6108,7 @@ class _dep_check_composite_db(dbapi):
ret.append(pkg.cpv)
if ret:
self._cpv_sort_ascending(ret)
- self._match_cache[orig_atom] = ret
+ self._match_cache[atom] = ret
return ret[:]
def _visible(self, pkg):
@@ -6175,45 +6172,6 @@ class _dep_check_composite_db(dbapi):
return False
return True
- def _dep_expand(self, atom):
- """
- This is only needed for old installed packages that may
- contain atoms that are not fully qualified with a specific
- category. Emulate the cpv_expand() function that's used by
- dbapi.match() in cases like this. If there are multiple
- matches, it's often due to a new-style virtual that has
- been added, so try to filter those out to avoid raising
- a ValueError.
- """
- root_config = self._depgraph.roots[self._root]
- orig_atom = atom
- expanded_atoms = self._depgraph._dep_expand(root_config, atom)
- if len(expanded_atoms) > 1:
- non_virtual_atoms = []
- for x in expanded_atoms:
- 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(
- [x.cp for x in expanded_atoms])
- if expanded_atoms:
- atom = expanded_atoms[0]
- else:
- null_atom = Atom(insert_category_into_atom(atom, "null"),
- allow_repo=True)
- cat, atom_pn = portage.catsplit(null_atom.cp)
- virts_p = root_config.settings.get_virts_p().get(atom_pn)
- if virts_p:
- # Allow the resolver to choose which virtual.
- atom = Atom(null_atom.replace('null/', 'virtual/', 1),
- allow_repo=True)
- else:
- atom = null_atom
- return atom
-
def aux_get(self, cpv, wants):
metadata = self._cpv_pkg_map[cpv].metadata
return [metadata.get(x, "") for x in wants]