Make depgraph._select_atoms() more flexible by allowing
authorZac Medico <zmedico@gentoo.org>
Sat, 27 Oct 2007 04:41:56 +0000 (04:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 27 Oct 2007 04:41:56 +0000 (04:41 -0000)
the repositories to be passed in as a parameter.

svn path=/main/trunk/; revision=8319

pym/_emerge/__init__.py

index 9c49274748b3bf5ab4eaa015f2a47d899f2efa62..5cac1f5285cc81f83f6eb455b531816e60723cb2 100644 (file)
@@ -1510,8 +1510,6 @@ class depgraph(object):
                                        print "Priority:", dep_priority
                                vardb = self.roots[dep_root].trees["vartree"].dbapi
                                try:
-                                       self._populate_filtered_repo(dep_root, dep_string,
-                                               myuse=myuse, strict=strict)
                                        selected_atoms = self._select_atoms(dep_root,
                                                dep_string, myuse=myuse, strict=strict)
                                except portage.exception.InvalidDependString, e:
@@ -1935,16 +1933,22 @@ class depgraph(object):
                                if atom_populated:
                                        break
 
-       def _select_atoms(self, root, depstring, myuse=None, strict=True):
-               """This will raise InvalidDependString if necessary."""
+       def _select_atoms(self, root, depstring, myuse=None, strict=True,
+               trees=None):
+               """This will raise InvalidDependString if necessary. If trees is
+               None then self._filtered_trees is used."""
                pkgsettings = self.pkgsettings[root]
+               if trees is None:
+                       trees = self._filtered_trees
+                       self._populate_filtered_repo(root, depstring,
+                               myuse=myuse, strict=strict)
                if True:
                        try:
                                if not strict:
                                        portage.dep._dep_check_strict = False
                                mycheck = portage.dep_check(depstring, None,
                                        pkgsettings, myuse=myuse,
-                                       myroot=root, trees=self._filtered_trees)
+                                       myroot=root, trees=trees)
                        finally:
                                portage.dep._dep_check_strict = True
                        if not mycheck[0]: