[bitbake-devel,05/14] toasterui: save warnings from non-build context

Submitted by Alexandru DAMIAN on April 4, 2014, 2:10 p.m.

Details

Message ID 6125ccede6e46d08bc05af70e87da47da900bc4b.1396620556.git.alexandru.damian@intel.com
State New
Headers show

Commit Message

Alexandru DAMIAN April 4, 2014, 2:10 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Some warnings and errors may come from a non-build context,
and they were not saved, even if they were counted for the current
build.

This patch saves these messages in memory until we have the
entire build context available.

	[YOCTO #5642]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 lib/bb/ui/buildinfohelper.py | 18 +++++++++++++-----
 lib/bb/ui/toasterui.py       |  3 ++-
 2 files changed, 15 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index dd93d0b..6965570 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -933,15 +933,23 @@  class BuildInfoHelper(object):
         self._store_log_information(LogMessage.ERROR, text)
 
     def store_log_event(self, event):
-        # look up license files info from insane.bbclass
-        m = re.match("([^:]*): md5 checksum matched for ([^;]*)", event.msg)
-        if m:
-            (pn, fn) = m.groups()
-            self.internal_state['recipes'][pn].save()
+        if 'build' in self.internal_state and 'backlog' in self.internal_state:
+            if len(self.internal_state['backlog']):
+                tempevent = self.internal_state['backlog'].pop()
+                print "Saving stored event ", tempevent
+                self.store_log_event(tempevent)
+            else:
+                del self.internal_state['backlog']
 
         if event.levelno < format.WARNING:
             return
+
         if not 'build' in self.internal_state:
+            print "Save event for later"
+            if not 'backlog' in self.internal_state:
+                self.internal_state['backlog'] = []
+            self.internal_state['backlog'].append(event)
+
             return
         log_information = {}
         log_information['build'] = self.internal_state['build']
diff --git a/lib/bb/ui/toasterui.py b/lib/bb/ui/toasterui.py
index 37d6b1a..9a9fe6f 100644
--- a/lib/bb/ui/toasterui.py
+++ b/lib/bb/ui/toasterui.py
@@ -143,6 +143,8 @@  def main(server, eventHandler, params ):
 
             # these events are unprocessed now, but may be used in the future to log
             # timing and error informations from the parsing phase in Toaster
+            if isinstance(event, (bb.event.SanityCheckPassed, bb.event.SanityCheck)):
+                continue
             if isinstance(event, bb.event.ParseStarted):
                 continue
             if isinstance(event, bb.event.ParseProgress):
@@ -209,7 +211,6 @@  def main(server, eventHandler, params ):
                 continue
 
             if isinstance(event, (bb.event.BuildCompleted)):
-                buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
                 continue
 
             if isinstance(event, (bb.command.CommandCompleted,