Prevent _combine_logentries() from generating redundant
authorZac Medico <zmedico@gentoo.org>
Fri, 19 Oct 2007 19:18:24 +0000 (19:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 19 Oct 2007 19:18:24 +0000 (19:18 -0000)
consecutive 'TYPE: phase' lines that show in summary.log
when the python-based elog functions are used.

svn path=/main/trunk/; revision=8182

pym/portage/elog/__init__.py

index 9e309f75f9026230d8f5ed02a92c608655cc04fd..4049b5521b494beaf3d674028ba67de7f54bf1c2 100644 (file)
@@ -33,8 +33,11 @@ def _combine_logentries(logentries):
        for phase in EBUILD_PHASES:
                if not phase in logentries:
                        continue
+               previous_type = None
                for msgtype, msgcontent in logentries[phase]:
-                       rValue += "%s: %s\n" % (msgtype, phase)
+                       if previous_type != msgtype:
+                               previous_type = msgtype
+                               rValue += "%s: %s\n" % (msgtype, phase)
                        for line in msgcontent:
                                rValue += line
                        rValue += "\n"