]> code.ossystems Code Review - openembedded-core.git/commitdiff
terminal.bbclass: Use BB_ORIGENV to restore user environmental variables
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Feb 2013 16:01:20 +0000 (16:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Feb 2013 23:40:22 +0000 (23:40 +0000)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/terminal.bbclass

index cec854d54a00711b037613bacad3e47ca519cf33..d5a6277896ccb05b3f29d41549a59a3c93e1c401 100644 (file)
@@ -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')