_get_dep_chain: include repo names v2.2.0_alpha162
authorZac Medico <zmedico@gentoo.org>
Tue, 12 Feb 2013 03:24:57 +0000 (19:24 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 12 Feb 2013 03:24:57 +0000 (19:24 -0800)
pym/_emerge/depgraph.py

index eb88357e1558970563200474ba5583bf433a995d..06a9a46d1f5b5a074d3d74594b4d1427656160a8 100644 (file)
@@ -3388,6 +3388,15 @@ class depgraph(object):
                child = None
                all_parents = self._dynamic_config._parent_atoms
                graph = self._dynamic_config.digraph
+               verbose_main_repo_display = "--verbose-main-repo-display" in \
+                       self._frozen_config.myopts
+
+               def format_pkg(pkg):
+                       pkg_name = "%s" % (pkg.cpv,)
+                       if verbose_main_repo_display or pkg.repo != \
+                               pkg.root_config.settings.repositories.mainRepo().name:
+                               pkg_name += _repo_separator + pkg.repo
+                       return pkg_name
 
                if target_atom is not None and isinstance(node, Package):
                        affecting_use = set()
@@ -3400,7 +3409,8 @@ class depgraph(object):
                                        if not node.installed:
                                                raise
                        affecting_use.difference_update(node.use.mask, node.use.force)
-                       pkg_name = "%s" % (node.cpv,)
+                       pkg_name = format_pkg(node)
+
                        if affecting_use:
                                usedep = []
                                for flag in affecting_use:
@@ -3497,7 +3507,7 @@ class depgraph(object):
                                affecting_use.difference_update(node.use.mask, \
                                        node.use.force)
 
-                               pkg_name = "%s" % (node.cpv,)
+                               pkg_name = format_pkg(node)
                                if affecting_use:
                                        usedep = []
                                        for flag in affecting_use: