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'],
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>"
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
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