diff options
-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 |