summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-10-03 19:54:23 +0200
committerZac Medico <zmedico@gentoo.org>2010-10-03 12:05:55 -0700
commitcf59cab2bdbd0e1d838cf2f5ee9c61b6f02ff3ac (patch)
tree14cbc574ec87cdff714fa9d5cfc4f5e0a4d1e53b
parenta20c2ecc5cbeadb66ca5292aeeaa1c3cdd091d4f (diff)
downloadportage-cf59cab2bdbd0e1d838cf2f5ee9c61b6f02ff3ac.tar.gz
portage-cf59cab2bdbd0e1d838cf2f5ee9c61b6f02ff3ac.tar.bz2
portage-cf59cab2bdbd0e1d838cf2f5ee9c61b6f02ff3ac.zip
Include repo info in emerge --info
-rw-r--r--pym/_emerge/actions.py5
-rw-r--r--pym/portage/repository/config.py25
2 files changed, 30 insertions, 0 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 7b7114849..a5bb0e52c 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1355,6 +1355,11 @@ def action_info(settings, trees, myopts, myfiles):
libtool_vers = ",".join(trees["/"]["vartree"].dbapi.match("sys-devel/libtool"))
+ repos = portdb.settings.repositories
+ writemsg_stdout("Repositories:\n\n")
+ for repo in repos:
+ writemsg_stdout(repo.info_string())
+
if "--verbose" in myopts:
myvars = list(settings)
else:
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 0e2507a82..29116c176 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -129,6 +129,31 @@ class RepoConfig(object):
except EnvironmentError:
return "x-" + os.path.basename(repo_path), True
+ def info_string(self):
+ """
+ Returns a formatted string containing informations about the repository.
+ Used by emerge --info.
+ """
+ indent = " " * 4
+ repo_msg = []
+ repo_msg.append(self.name)
+ if self.format:
+ repo_msg.append(indent + "format: " + self.format)
+ if self.user_location:
+ repo_msg.append(indent + "location: " + self.user_location)
+ if self.sync:
+ repo_msg.append(indent + "sync: " + self.sync)
+ if self.masters:
+ repo_msg.append(indent + "masters: " + " ".join(master.name for master in self.masters))
+ if self.priority:
+ repo_msg.append(indent + "priority: " + str(self.priority))
+ if self.aliases:
+ repo_msg.append(indent + "aliases: " + self.aliases)
+ if self.eclass_overrides:
+ repo_msg.append(indent + "eclass_overrides: " + self.eclass_overrides)
+ repo_msg.append("")
+ return "\n".join(repo_msg) + "\n"
+
class RepoConfigLoader(object):
"""Loads and store config of several repositories, loaded from PORTDIR_OVERLAY or repos.conf"""
def __init__(self, paths, settings):