diff options
author | Michał Górny <mgorny@gentoo.org> | 2010-12-29 14:37:25 +0100 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-12-29 09:54:11 -0800 |
commit | f5069517b6ecebc5c25aaf7cf80922bed6d8e62c (patch) | |
tree | 7795f3f33761ef8f6f364ecc62aaead355f54392 | |
parent | 8d42d71c7e4609ea2332a8189ef1c63357f1b771 (diff) | |
download | portage-f5069517b6ecebc5c25aaf7cf80922bed6d8e62c.tar.gz portage-f5069517b6ecebc5c25aaf7cf80922bed6d8e62c.tar.bz2 portage-f5069517b6ecebc5c25aaf7cf80922bed6d8e62c.zip |
EbuildPhase: Display upstream info before setup.
Display upstream maintainers and bugtrackers along with Gentoo
maintainers when emerging a package.
-rw-r--r-- | pym/_emerge/EbuildPhase.py | 5 | ||||
-rw-r--r-- | pym/portage/xml/metadata.py | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py index 6197d81d6..e3270c893 100644 --- a/pym/_emerge/EbuildPhase.py +++ b/pym/_emerge/EbuildPhase.py @@ -61,6 +61,7 @@ class EbuildPhase(CompositeTask): use = self.settings['PORTAGE_USE'] maint_str = "" + upstr_str = "" metadata_xml_path = os.path.join(os.path.dirname(self.settings['EBUILD']), "metadata.xml") if os.path.isfile(metadata_xml_path): herds_path = os.path.join(self.settings['PORTDIR'], @@ -68,6 +69,7 @@ class EbuildPhase(CompositeTask): try: metadata_xml = MetaDataXML(metadata_xml_path, herds_path) maint_str = metadata_xml.format_maintainer_string() + upstr_str = metadata_xml.format_upstream_string() except SyntaxError: maint_str = "<invalid metadata.xml>" @@ -77,6 +79,9 @@ class EbuildPhase(CompositeTask): msg.append("Repository: %s" % self.settings['PORTAGE_REPO_NAME']) if maint_str: msg.append("Maintainer: %s" % maint_str) + if upstr_str: + msg.append("Upstream: %s" % upstr_str) + msg.append("USE: %s" % use) relevant_features = [] enabled_features = self.settings.features diff --git a/pym/portage/xml/metadata.py b/pym/portage/xml/metadata.py index 2d62bba99..326a468b3 100644 --- a/pym/portage/xml/metadata.py +++ b/pym/portage/xml/metadata.py @@ -348,3 +348,29 @@ class MetaDataXML(object): maint_str += " " + ",".join(maintainers) return maint_str + + def format_upstream_string(self): + """Format string containing upstream maintainers and bugtrackers. + Used by emerge to display upstream information. + + @rtype: String + @return: a string containing upstream maintainers and bugtrackers + """ + maintainers = [] + for upstream in self.upstream(): + for maintainer in upstream.maintainers: + if maintainer.email is None or not maintainer.email.strip(): + if maintainer.name and maintainer.name.strip(): + maintainers.append(maintainer.name) + else: + maintainers.append(maintainer.email) + + for bugtracker in upstream.bugtrackers: + if bugtracker.startswith("mailto:"): + bugtracker = bugtracker[7:] + maintainers.append(bugtracker) + + + maintainers = list(unique_everseen(maintainers)) + maint_str = " ".join(maintainers) + return maint_str |