[bitbake-devel] [PATCH 1/4] data|cooker: use saved environment variables when calling inheritFromOS

Joshua Lock josh at linux.intel.com
Mon Jul 25 18:56:09 UTC 2011


Now that we have a pristine copy of the variables available at launch time
we can use them when looking to inherit the OS's environment.

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 lib/bb/cooker.py |    2 +-
 lib/bb/data.py   |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index d8535a7..1b5101d 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -132,7 +132,7 @@ class BBCooker:
 
         self.configuration.data = bb.data.init()
 
-        bb.data.inheritFromOS(self.configuration.data)
+        bb.data.inheritFromOS(self.configuration.data, self.savedenv)
 
         try:
             self.parseConfigurationFiles(self.configuration.prefile,
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 2269f9d..65144bf 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -159,12 +159,12 @@ def expandKeys(alterdata, readdata = None):
         ekey = todolist[key]
         renameVar(key, ekey, alterdata)
 
-def inheritFromOS(d):
-    """Inherit variables from the environment."""
+def inheritFromOS(d, savedenv):
+    """Inherit variables from the initial environment."""
     exportlist = bb.utils.preserved_envvars_exported()
-    for s in os.environ.keys():
+    for s in savedenv.keys():
         try:
-            setVar(s, os.environ[s], d)
+            setVar(s, getVar(s, savedenv, True), d)
             if s in exportlist:
                 setVarFlag(s, "export", True, d)
         except TypeError:
-- 
1.7.6





More information about the bitbake-devel mailing list