diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-11 11:00:45 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-11 11:07:16 +0000 |
commit | fc330d810099c57fefd4e706159a73ad8401d97c (patch) | |
tree | 267162caaf128e17a8e0437546f7b31252a242fb /bin/bitbake | |
parent | bb53b47710ca4579e20284668cb354f734c3d502 (diff) | |
download | bitbake-contrib-fc330d810099c57fefd4e706159a73ad8401d97c.tar.gz |
bitbake/utils: Improve environment handling to allow UIs access to original environment
We need to empty out the environment whilst we build the cooker but
we need the environment for the UIs since hob uses DISPLAY and other
session variables.
This patch adapts the utils functions to return removed environment
components so we can reinject them for use by the UI, allowing hob
to work again.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-x | bin/bitbake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/bitbake b/bin/bitbake index 89289050d..40b50e168 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -229,10 +229,8 @@ Default BBFILES are the .bb files in the current directory.""") # Before we start modifying the environment we should take a pristine # copy for possible later use initialenv = os.environ.copy() - # Clear away any spurious environment variables. But don't wipe the - # environment totally. This is necessary to ensure the correct operation - # of the UIs (e.g. for DISPLAY, etc.) - bb.utils.clean_environment() + # Clear away any spurious environment variables while we stoke up the cooker + cleanedvars = bb.utils.clean_environment() server = server.BitBakeServer() if configuration.bind: @@ -258,6 +256,10 @@ Default BBFILES are the .bb files in the current directory.""") # Setup a connection to the server (cooker) server_connection = server.establishConnection() + # Restore the environment in case the UI needs it + for k in cleanedvars: + os.environ[k] = cleanedvars[k] + try: return server.launchUI(ui_main, server_connection.connection, server_connection.events) finally: |