diff options
-rw-r--r-- | meta/classes/terminal.bbclass | 8 | ||||
-rw-r--r-- | meta/lib/oe/terminal.py | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass index a94f755a40..cd8d124507 100644 --- a/meta/classes/terminal.bbclass +++ b/meta/classes/terminal.bbclass | |||
@@ -88,8 +88,12 @@ def oe_terminal(command, title, d): | |||
88 | 88 | ||
89 | try: | 89 | try: |
90 | oe.terminal.spawn_preferred(command, title, None, d) | 90 | oe.terminal.spawn_preferred(command, title, None, d) |
91 | except oe.terminal.NoSupportedTerminals: | 91 | except oe.terminal.NoSupportedTerminals as nosup: |
92 | bb.fatal('No valid terminal found, unable to open devshell') | 92 | nosup.terms.remove("false") |
93 | cmds = '\n\t'.join(nosup.terms).replace("{command}", | ||
94 | "do_terminal").replace("{title}", title) | ||
95 | bb.fatal('No valid terminal found, unable to open devshell.\n' + | ||
96 | 'Tried the following commands:\n\t%s' % cmds) | ||
93 | except oe.terminal.ExecutionError as exc: | 97 | except oe.terminal.ExecutionError as exc: |
94 | bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc)) | 98 | bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc)) |
95 | 99 | ||
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 7446c44c49..38e66cef1f 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py | |||
@@ -11,7 +11,8 @@ class UnsupportedTerminal(Exception): | |||
11 | pass | 11 | pass |
12 | 12 | ||
13 | class NoSupportedTerminals(Exception): | 13 | class NoSupportedTerminals(Exception): |
14 | pass | 14 | def __init__(self, terms): |
15 | self.terms = terms | ||
15 | 16 | ||
16 | 17 | ||
17 | class Registry(oe.classutils.ClassRegistry): | 18 | class Registry(oe.classutils.ClassRegistry): |
@@ -209,6 +210,14 @@ class Custom(Terminal): | |||
209 | def prioritized(): | 210 | def prioritized(): |
210 | return Registry.prioritized() | 211 | return Registry.prioritized() |
211 | 212 | ||
213 | def get_cmd_list(): | ||
214 | terms = Registry.prioritized() | ||
215 | cmds = [] | ||
216 | for term in terms: | ||
217 | if term.command: | ||
218 | cmds.append(term.command) | ||
219 | return cmds | ||
220 | |||
212 | def spawn_preferred(sh_cmd, title=None, env=None, d=None): | 221 | def spawn_preferred(sh_cmd, title=None, env=None, d=None): |
213 | """Spawn the first supported terminal, by priority""" | 222 | """Spawn the first supported terminal, by priority""" |
214 | for terminal in prioritized(): | 223 | for terminal in prioritized(): |
@@ -218,7 +227,7 @@ def spawn_preferred(sh_cmd, title=None, env=None, d=None): | |||
218 | except UnsupportedTerminal: | 227 | except UnsupportedTerminal: |
219 | continue | 228 | continue |
220 | else: | 229 | else: |
221 | raise NoSupportedTerminals() | 230 | raise NoSupportedTerminals(get_cmd_list()) |
222 | 231 | ||
223 | def spawn(name, sh_cmd, title=None, env=None, d=None): | 232 | def spawn(name, sh_cmd, title=None, env=None, d=None): |
224 | """Spawn the specified terminal, by name""" | 233 | """Spawn the specified terminal, by name""" |