From: Sebastian Luther Date: Sun, 3 Oct 2010 17:54:23 +0000 (+0200) Subject: Include repo info in emerge --info X-Git-Tag: v2.2_rc90~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cf59cab2bdbd0e1d838cf2f5ee9c61b6f02ff3ac;p=portage.git Include repo info in emerge --info --- 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):