[bitbake-devel] [PATCH 60/94] bitbake: dsi: small bugfixes in data collection

Alex DAMIAN alexandru.damian at intel.com
Tue Sep 24 16:52:29 UTC 2013


From: Alexandru DAMIAN <alexandru.damian at intel.com>

A couple of bugfixes in the data collection:
- cache the TMPDIR since it's not gonna change during the build
- CommandCompleted can be issues outside of a build,  so
update the build only if we're running one

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 232eea8..6f4789c 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -161,6 +161,7 @@ class BuildInfoHelper(object):
         self.server = server
         self.orm_wrapper = ORMWrapper()
         self.has_build_history = has_build_history
+        self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
 
     def _configure_django(self):
         # Add webhob to sys path for importing modules
@@ -298,13 +299,12 @@ class BuildInfoHelper(object):
     def _get_path_information(self, task_object):
         build_stats_format = "{tmpdir}/buildstats/{target}-{machine}/{buildname}/{package}/"
 
-        tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
         target = self.internal_state['target']
         machine = self.internal_state['build'].machine.name
         buildname = self.internal_state['build'].build_name
         package = task_object.recipe.name + "-" + task_object.recipe.version.strip(":")
 
-        build_stats_path = build_stats_format.format(tmpdir=tmp_dir, target=target,
+        build_stats_path = build_stats_format.format(tmpdir=self.tmp_dir, target=target,
                                                      machine=machine, buildname=buildname,
                                                      package=package)
 
@@ -373,7 +373,8 @@ class BuildInfoHelper(object):
 
 
     def update_build_information(self, event, errors, warnings, taskfailures):
-        self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures)
+        if 'build' in self.internal_state:
+            self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures)
 
     def store_started_task(self, event):
         identifier = re.split(':', event.taskfile)[-1] + event.taskname
-- 
1.8.1.2




More information about the bitbake-devel mailing list