Patchwork [bitbake-devel] cooker: Only change self.data if it exists

login
register
mail settings
Submitter Richard Purdie
Date March 28, 2014, 11:06 a.m.
Message ID <1396004778.24890.172.camel@ted>
Download mbox | patch
Permalink /patch/69565/
State New
Headers show

Comments

Richard Purdie - March 28, 2014, 11:06 a.m.
With the change to more optimal default featureset behaviour, a race was
exposed by hob where the code may try and change self.data before it
exists. This change avoids that.

When the datastore is created, the cooker configuration is used so
data tracking is correctly handled regardless.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index e81d887..5d3ac60 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -207,11 +207,13 @@  class BBCooker:
 
     def enableDataTracking(self):
         self.configuration.tracking = True
-        self.data.enableTracking()
+        if hasattr(self, "data"):
+            self.data.enableTracking()
 
     def disableDataTracking(self):
         self.configuration.tracking = False
-        self.data.disableTracking()
+        if hasattr(self, "data"):
+            self.data.disableTracking()
 
     def modifyConfigurationVar(self, var, val, default_file, op):
         if op == "append":