[bitbake-devel] [PATCH 07/16] data: Cache an list of export variables

Richard Purdie richard.purdie at linuxfoundation.org
Mon Sep 16 21:53:24 UTC 2013


Compute a cache of the list of potential export variables so
that we don't have to compute the list from scratch.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/data.py       | 2 +-
 lib/bb/data_smart.py | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/bb/data.py b/lib/bb/data.py
index beaf089..ecac66c 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -342,7 +342,7 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
 def generate_dependencies(d):
 
     keys = set(key for key in d if not key.startswith("__"))
-    shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport"))
+    shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport"))
     vardepvals = set(key for key in keys if d.getVarFlag(key, "vardepvalue"))
 
     deps = {}
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index a6a4b6c..1bb186e 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -578,6 +578,13 @@ class DataSmart(MutableMapping):
         if flag == "defaultval" and '_' in var:
             self._setvar_update_overrides(var)
 
+        if flag == "unexport" or flag == "export":
+            if not "__exportlist" in self.dict:
+                self._makeShadowCopy("__exportlist")
+            if not "_content" in self.dict["__exportlist"]:
+                self.dict["__exportlist"]["_content"] = set()
+            self.dict["__exportlist"]["_content"].add(var)
+
     def getVarFlag(self, var, flag, expand=False, noweakdefault=False):
         local_var = self._findVar(var)
         value = None
-- 
1.8.1.2




More information about the bitbake-devel mailing list