summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-22 10:21:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-25 12:54:17 +0100
commite51d542e78b70c2f854bd8b14b24dfd3f43a5ff4 (patch)
tree5e8a2a9cfe460d0bb797d6df065c5b9fff8dbab4 /bitbake
parent72e0b43e0149ba63936aae69bc6028e997f7df12 (diff)
downloadpoky-e51d542e78b70c2f854bd8b14b24dfd3f43a5ff4.tar.gz
bitbake|cooker: save a copy of the environment when BitBake is started
Create a data store in the cooker containing the values of the environment from when BitBake is launched such that child processes can replicate (and/or use values from) the host environment, rather than the cleaned up environment that the main BitBake process uses. (Bitbake rev: 54c7206165c0e7cfe5f7b243c80461baf5e7dfb1) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/bitbake5
-rw-r--r--bitbake/lib/bb/cooker.py10
2 files changed, 13 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 8d6fef7b8b..5398cf122a 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -197,6 +197,9 @@ Default BBFILES are the .bb files in the current directory.""")
197 handler = bb.event.LogHandler() 197 handler = bb.event.LogHandler()
198 logger.addHandler(handler) 198 logger.addHandler(handler)
199 199
200 # Before we start modifying the environment we should take a pristine
201 # copy for possible later use
202 initialenv = os.environ.copy()
200 # Clear away any spurious environment variables. But don't wipe the 203 # Clear away any spurious environment variables. But don't wipe the
201 # environment totally. This is necessary to ensure the correct operation 204 # environment totally. This is necessary to ensure the correct operation
202 # of the UIs (e.g. for DISPLAY, etc.) 205 # of the UIs (e.g. for DISPLAY, etc.)
@@ -207,7 +210,7 @@ Default BBFILES are the .bb files in the current directory.""")
207 server.initServer() 210 server.initServer()
208 idle = server.getServerIdleCB() 211 idle = server.getServerIdleCB()
209 212
210 cooker = bb.cooker.BBCooker(configuration, idle) 213 cooker = bb.cooker.BBCooker(configuration, idle, initialenv)
211 cooker.parseCommandLine() 214 cooker.parseCommandLine()
212 215
213 server.addcooker(cooker) 216 server.addcooker(cooker)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index b0ddb2e112..044ceb179e 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -78,7 +78,7 @@ class BBCooker:
78 Manages one bitbake build run 78 Manages one bitbake build run
79 """ 79 """
80 80
81 def __init__(self, configuration, server_registration_cb): 81 def __init__(self, configuration, server_registration_cb, savedenv={}):
82 self.status = None 82 self.status = None
83 self.appendlist = {} 83 self.appendlist = {}
84 self.skiplist = {} 84 self.skiplist = {}
@@ -87,6 +87,14 @@ class BBCooker:
87 87
88 self.configuration = configuration 88 self.configuration = configuration
89 89
90 # Keep a datastore of the initial environment variables and their
91 # values from when BitBake was launched to enable child processes
92 # to use environment variables which have been cleaned from the
93 # BitBake processes env
94 self.savedenv = bb.data.init()
95 for k in savedenv:
96 self.savedenv.setVar(k, savedenv[k])
97
90 self.caches_array = [] 98 self.caches_array = []
91 # Currently, only Image Creator hob ui needs extra cache. 99 # Currently, only Image Creator hob ui needs extra cache.
92 # So, we save Extra Cache class name and container file 100 # So, we save Extra Cache class name and container file