Patchwork [bitbake-devel,29/94] bitbake: dsi: fix the reading of task event information

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:51 p.m.
Message ID <503d29a10820131264247495f7740bf5207195aa.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58721/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:51 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Fixing a problem where the event outcome wasn't processed.
Moving all the event-type-dependent code at the same level
in the class.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index d489c87..6eafea0 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -231,14 +231,6 @@  class BuildInfoHelper(object):
         task_information = {}
         task_information['build'] = self.internal_state['build']
         task_information['outcome'] = Task.OUTCOME_NA
-        if isinstance(event, bb.runqueue.runQueueTaskSkipped):
-            task_information['task_executed'] = False
-            if event._skip == "covered":
-                task_information['outcome'] = Task.OUTCOME_COVERED
-            if event._skip == "existing":
-                task_information['outcome'] = Task.OUTCOME_EXISTING
-        else:
-            task_information['task_executed'] = True
         task_information['recipe'] = recipe
         task_information['task_name'] = event.taskname
         return task_information
@@ -360,10 +352,19 @@  class BuildInfoHelper(object):
         recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
 
         task_information = self._get_task_information(event, recipe)
+        task_information['outcome'] = Task.OUTCOME_NA
+
+        if isinstance(event, bb.runqueue.runQueueTaskSkipped):
+            task_information['task_executed'] = False
+            if event.reason == "covered":
+                task_information['outcome'] = Task.OUTCOME_COVERED
+            if event.reason == "existing":
+                task_information['outcome'] = Task.OUTCOME_EXISTING
+        else:
+            task_information['task_executed'] = True
 
         self.task_order += 1
         task_information['order'] = self.task_order
-        task_information['outcome'] = Task.OUTCOME_NA
         task_obj = self.orm_wrapper.get_update_task_object(task_information)
 
         self.internal_state[identifier] = {'start_time': datetime.datetime.now()}
@@ -385,6 +386,10 @@  class BuildInfoHelper(object):
             task_information['disk_io'] = task_build_stats['disk_io']
             del self.internal_state[identifier]
 
+        if isinstance(event, bb.runqueue.runQueueTaskFailed):
+            task_information['outcome'] = Task.OUTCOME_FAILED
+            del self.internal_state[identifier]
+
         #TODO: get error number
         #TODO: get warnings number
         #TODO: get warning information