summaryrefslogtreecommitdiffstats
path: root/meta/classes/terminal.bbclass
diff options
context:
space:
mode:
authorMorten Minde Neergaard <mneergaa@cisco.com>2012-10-19 10:37:07 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-24 11:50:46 (GMT)
commitc45a7d127e76a43069f12483b7453a3778ae0126 (patch)
tree1539f43e6b76e0052ace73882ffdcc9f125b6660 /meta/classes/terminal.bbclass
parent6309eea2a8fa97ec46a5d1583d72a6a9ba02754e (diff)
downloadpoky-c45a7d127e76a43069f12483b7453a3778ae0126.tar.gz
terminal: Add support for running custom terminals.
Example config: OE_TERMINAL = "custom" OE_TERMINAL_CUSTOMCMD = "mysuperterm" (From OE-Core rev: c76da87511d2668479745c2f18b8a9b8116c7489) Signed-off-by: Morten Minde Neergaard <mneergaa@cisco.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/terminal.bbclass')
-rw-r--r--meta/classes/terminal.bbclass10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index 2cd6f4c..51846c1 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -4,7 +4,7 @@ OE_TERMINAL[choices] = 'auto none \
4 ${@" ".join(o.name \ 4 ${@" ".join(o.name \
5 for o in oe.terminal.prioritized())}' 5 for o in oe.terminal.prioritized())}'
6 6
7OE_TERMINAL_EXPORTS = 'XAUTHORITY SHELL DBUS_SESSION_BUS_ADDRESS DISPLAY EXTRA_OEMAKE SCREENDIR' 7OE_TERMINAL_EXPORTS += 'XAUTHORITY SHELL DBUS_SESSION_BUS_ADDRESS DISPLAY EXTRA_OEMAKE SCREENDIR'
8OE_TERMINAL_EXPORTS[type] = 'list' 8OE_TERMINAL_EXPORTS[type] = 'list'
9 9
10XAUTHORITY ?= "${HOME}/.Xauthority" 10XAUTHORITY ?= "${HOME}/.Xauthority"
@@ -15,17 +15,19 @@ def oe_terminal(command, title, d):
15 import oe.data 15 import oe.data
16 import oe.terminal 16 import oe.terminal
17 17
18 env = dict()
19
18 for export in oe.data.typed_value('OE_TERMINAL_EXPORTS', d): 20 for export in oe.data.typed_value('OE_TERMINAL_EXPORTS', d):
19 value = d.getVar(export, True) 21 value = d.getVar(export, True)
20 if value is not None: 22 if value is not None:
21 os.environ[export] = str(value) 23 env[export] = str(value)
22 24
23 terminal = oe.data.typed_value('OE_TERMINAL', d).lower() 25 terminal = oe.data.typed_value('OE_TERMINAL', d).lower()
24 if terminal == 'none': 26 if terminal == 'none':
25 bb.fatal('Devshell usage disabled with OE_TERMINAL') 27 bb.fatal('Devshell usage disabled with OE_TERMINAL')
26 elif terminal != 'auto': 28 elif terminal != 'auto':
27 try: 29 try:
28 oe.terminal.spawn(terminal, command, title, None, d) 30 oe.terminal.spawn(terminal, command, title, env, d)
29 return 31 return
30 except oe.terminal.UnsupportedTerminal: 32 except oe.terminal.UnsupportedTerminal:
31 bb.warn('Unsupported terminal "%s", defaulting to "auto"' % 33 bb.warn('Unsupported terminal "%s", defaulting to "auto"' %
@@ -34,7 +36,7 @@ def oe_terminal(command, title, d):
34 bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc)) 36 bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
35 37
36 try: 38 try:
37 oe.terminal.spawn_preferred(command, title, None, d) 39 oe.terminal.spawn_preferred(command, title, env, d)
38 except oe.terminal.NoSupportedTerminals: 40 except oe.terminal.NoSupportedTerminals:
39 bb.fatal('No valid terminal found, unable to open devshell') 41 bb.fatal('No valid terminal found, unable to open devshell')
40 except oe.terminal.ExecutionError as exc: 42 except oe.terminal.ExecutionError as exc: