summaryrefslogtreecommitdiff
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorStephano Cetola <stephano.cetola@linux.intel.com>2016-11-14 18:30:11 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-23 11:02:28 +0000
commitc077f4aab2fc956408d4ad45c4e2e2ea6e480624 (patch)
tree174458733234d3da3b91a516d1fe6f44a7cb030d /meta/lib/oe
parente12912ac7484654c201d167831b302a821e14972 (diff)
downloadopenembedded-core-c077f4aab2fc956408d4ad45c4e2e2ea6e480624.tar.gz
openembedded-core-c077f4aab2fc956408d4ad45c4e2e2ea6e480624.tar.bz2
openembedded-core-c077f4aab2fc956408d4ad45c4e2e2ea6e480624.zip
devshell: list commands when throwing NoSupportedTerminals
When attempting to run devshell, if no terminal is available, the error being thrown was not very specific. This adds a list of commands that failed, informing the user of what they can install to fix the error. [ YOCTO #10472] Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/terminal.py13
1 files changed, 11 insertions, 2 deletions
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):
pass
class NoSupportedTerminals(Exception):
- pass
+ def __init__(self, terms):
+ self.terms = terms
class Registry(oe.classutils.ClassRegistry):
@@ -209,6 +210,14 @@ class Custom(Terminal):
def prioritized():
return Registry.prioritized()
+def get_cmd_list():
+ terms = Registry.prioritized()
+ cmds = []
+ for term in terms:
+ if term.command:
+ cmds.append(term.command)
+ return cmds
+
def spawn_preferred(sh_cmd, title=None, env=None, d=None):
"""Spawn the first supported terminal, by priority"""
for terminal in prioritized():
@@ -218,7 +227,7 @@ def spawn_preferred(sh_cmd, title=None, env=None, d=None):
except UnsupportedTerminal:
continue
else:
- raise NoSupportedTerminals()
+ raise NoSupportedTerminals(get_cmd_list())
def spawn(name, sh_cmd, title=None, env=None, d=None):
"""Spawn the specified terminal, by name"""