Preserve message continuity in elog_process().
authorZac Medico <zmedico@gentoo.org>
Thu, 7 Oct 2010 18:31:35 +0000 (11:31 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 7 Oct 2010 19:17:29 +0000 (12:17 -0700)
pym/portage/elog/__init__.py
pym/portage/elog/messages.py

index 090b541b8e42dfdb2083cc767c0f24be23955b42..78b6d83983941e5bb1da12c47a24b96ad4f6b500 100644 (file)
@@ -93,7 +93,7 @@ def elog_process(cpv, mysettings, phasefilter=None):
                # A build dir isn't necessarily required since the messages.e*
                # functions allow messages to be generated in-memory.
                ebuild_logentries = {}
-       all_logentries = collect_messages()
+       all_logentries = collect_messages(key=cpv)
        if cpv in all_logentries:
                # Messages generated by the python elog implementation are assumed
                # to come first. For example, this ensures correct order for einfo
index 9a0e510fb7d313bcbb43a0487ca8bdde89bd208c..bee0a7747699d846bd3e82035a0b0aca09c37e0e 100644 (file)
@@ -121,11 +121,16 @@ def _elog_base(level, msg, phase="other", key=None, color=None, out=None):
 
        #raise NotImplementedError()
 
-def collect_messages():
+def collect_messages(key=None):
        global _msgbuffer
 
-       rValue = _msgbuffer
-       _reset_buffer()
+       if key is None:
+               rValue = _msgbuffer
+               _reset_buffer()
+       else:
+               rValue = {}
+               if key in _msgbuffer:
+                       rValue[key] = _msgbuffer.pop(key)
        return rValue
 
 def _reset_buffer():