data|cooker: use saved environment variables when calling inheritFromOS
authorJoshua Lock <josh@linux.intel.com>
Mon, 25 Jul 2011 18:27:55 +0000 (11:27 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 Jul 2011 12:46:27 +0000 (13:46 +0100)
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.

(Bitbake rev: 21c21fcc5871e81d8d497b6baed605cdd74c4571)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/cooker.py
bitbake/lib/bb/data.py

index 044ceb1..f99d786 100644 (file)
@@ -135,7 +135,7 @@ class BBCooker:
         if not self.server_registration_cb:
             bb.data.setVar("BB_WORKERCONTEXT", "1", self.configuration.data)
 
-        bb.data.inheritFromOS(self.configuration.data)
+        bb.data.inheritFromOS(self.configuration.data, self.savedenv)
 
         try:
             self.parseConfigurationFiles(self.configuration.prefile,
index 2269f9d..65144bf 100644 (file)
@@ -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: