Remove the depgraph._get_arg_for_pkg() method since _iter_atoms_for_pkg()
authorZac Medico <zmedico@gentoo.org>
Tue, 8 Apr 2008 03:54:22 +0000 (03:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 8 Apr 2008 03:54:22 +0000 (03:54 -0000)
does the job.

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

pym/_emerge/__init__.py

index 86f09af3936897d82557482fc0a4fc8d7aab6125..ed0b8aafa750057bf53a375e8a5d7d7a661f1e82 100644 (file)
@@ -1734,7 +1734,9 @@ class depgraph(object):
                                myarg = None
                                if dep.root == self.target_root:
                                        try:
-                                               myarg = self._get_arg_for_pkg(dep_pkg)
+                                               myarg = self._iter_atoms_for_pkg(dep_pkg).next()
+                                       except StopIteration:
+                                               pass
                                        except portage.exception.InvalidDependString:
                                                if not dep_pkg.installed:
                                                        # This shouldn't happen since the package
@@ -2026,21 +2028,6 @@ class depgraph(object):
                                        continue
                                yield arg, atom
 
-       def _get_arg_for_pkg(self, pkg):
-               """
-               Return a matching DependencyArg instance for the given Package if
-               any exist, otherwise None. An attempt will be made to return the most
-               specific match (PackageArg type is the most specific).
-
-               This will raise an InvalidDependString exception if PROVIDE is invalid.
-               """
-               any_arg = None
-               for arg, atom in self._iter_atoms_for_pkg(pkg):
-                       if isinstance(arg, PackageArg):
-                               return arg
-                       any_arg = arg
-               return any_arg
-
        def select_files(self, myfiles):
                """Given a list of .tbz2s, .ebuilds sets, and deps, create the
                appropriate depgraph and return a favorite list."""