diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-05 16:01:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-06 23:40:22 +0000 |
commit | 131643695d7ba9d0c32bf8e192e7e3942f50f318 (patch) | |
tree | 48495b9197feb42bc953c3f53925e30447e30e65 /meta/classes | |
parent | cb21af00f9321ea48e533089dbffbb1a9665cb92 (diff) | |
download | openembedded-core-131643695d7ba9d0c32bf8e192e7e3942f50f318.tar.gz openembedded-core-131643695d7ba9d0c32bf8e192e7e3942f50f318.tar.bz2 openembedded-core-131643695d7ba9d0c32bf8e192e7e3942f50f318.zip |
terminal.bbclass: Use BB_ORIGENV to restore user environmental variables
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/terminal.bbclass | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass index cec854d54a..d5a6277896 100644 --- a/meta/classes/terminal.bbclass +++ b/meta/classes/terminal.bbclass @@ -4,7 +4,7 @@ OE_TERMINAL[choices] = 'auto none \ ${@" ".join(o.name \ for o in oe.terminal.prioritized())}' -OE_TERMINAL_EXPORTS += 'XAUTHORITY SHELL DBUS_SESSION_BUS_ADDRESS DISPLAY EXTRA_OEMAKE SCREENDIR' +OE_TERMINAL_EXPORTS += 'EXTRA_OEMAKE' OE_TERMINAL_EXPORTS[type] = 'list' XAUTHORITY ?= "${HOME}/.Xauthority" @@ -26,6 +26,17 @@ def oe_terminal(command, title, d): os.environ[export] = str(value) env[export] = str(value) + # Add in all variables from the user's original environment which + # haven't subsequntly been set/changed + origbbenv = d.getVar("BB_ORIGENV", False) or {} + for key in origbbenv: + if key in env: + continue + value = origbbenv.getVar(key, True) + if value is not None: + os.environ[key] = str(value) + env[key] = str(value) + terminal = oe.data.typed_value('OE_TERMINAL', d).lower() if terminal == 'none': bb.fatal('Devshell usage disabled with OE_TERMINAL') |