Make MetaDataXML.format_maintainer_string() check a values to make
authorZac Medico <zmedico@gentoo.org>
Sat, 25 Sep 2010 20:13:50 +0000 (13:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 25 Sep 2010 20:13:50 +0000 (13:13 -0700)
sure they are non-empty and not just whitespace.

pym/portage/xml/metadata.py

index c357d99667d098d6bd1967ac560b8cc24ce24658..2d62bba992b1a32ceab97bbea8a069b562843778 100644 (file)
@@ -323,16 +323,18 @@ class MetaDataXML(object):
                """
                maintainers = []
                for maintainer in self.maintainers():
-                       if maintainer.email is None:
-                               maintainers.append(maintainer.name)
+                       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 herd, email in self.herds(include_email=True):
                        if herd == "no-herd":
                                continue
-                       if email is None:
-                               maintainers.append(herd)
+                       if email is None or not email.strip():
+                               if herd and herd.strip():
+                                       maintainers.append(herd)
                        else:
                                maintainers.append(email)