diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-04-08 23:55:25 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-04-08 23:55:25 +0000 |
commit | 54d03621bfb6bc13911a2461ad818aa744285fbe (patch) | |
tree | 0292c47ec82933592e544d6e47bb04136eb11f47 | |
parent | 9b89d3055a2087f9aed6aa7d356ab64ad80f5f4d (diff) | |
download | portage-54d03621bfb6bc13911a2461ad818aa744285fbe.tar.gz portage-54d03621bfb6bc13911a2461ad818aa744285fbe.tar.bz2 portage-54d03621bfb6bc13911a2461ad818aa744285fbe.zip |
Split out a depgraph method to check if a specific new-style virtual
package exists.
svn path=/main/trunk/; revision=9761
-rw-r--r-- | pym/_emerge/__init__.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 46a569ed4..955ab8979 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2011,6 +2011,15 @@ class depgraph(object): return 0 return 1 + def _have_new_virt(self, root, atom_cp): + ret = False + for db, pkg_type, built, installed, db_keys in \ + self._filtered_trees[root]["dbs"]: + if db.cp_list(atom_cp): + ret = True + break + return ret + def _iter_atoms_for_pkg(self, pkg): # TODO: add multiple $ROOT support if pkg.root != self.target_root: @@ -2018,15 +2027,9 @@ class depgraph(object): atom_arg_map = self._atom_arg_map for atom in self._set_atoms.iterAtomsForPackage(pkg): atom_cp = portage.dep_getkey(atom) - if atom_cp != pkg.cp: - have_new_virt = False - for db, pkg_type, built, installed, db_keys in \ - self._filtered_trees[pkg.root]["dbs"]: - if db.cp_list(atom_cp): - have_new_virt = True - break - if have_new_virt: - continue + if atom_cp != pkg.cp and \ + self._have_new_virt(pkg.root, atom_cp): + continue for arg in atom_arg_map[(atom, pkg.root)]: if isinstance(arg, PackageArg) and \ arg.package != pkg: |