diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2011-09-16 17:36:12 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-09-19 04:52:48 +0100 |
commit | 9b5175255b134d5d855234a44316a6a034a1f210 (patch) | |
tree | d8844f2d18aad6cd100e359c4e6b27ae6a1abc6c /meta | |
parent | aed52479805b7a3d6721d3aa8e4195d2a41a57d7 (diff) | |
download | ast2050-yocto-poky-9b5175255b134d5d855234a44316a6a034a1f210.zip ast2050-yocto-poky-9b5175255b134d5d855234a44316a6a034a1f210.tar.gz |
lib/oe/terminal.py: declare konsole from KDE 4.x as unsupported
Konsole 2.x (from KDE 4.x) does not work as devshell - it does not pass
the environment or current working directory through among other issues,
so do a version check and disable it if it is found (skipping to the
next available terminal application.)
(From OE-Core rev: ee57cd7deb778dc72e58668d8c71cf840a3bc0d9)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/terminal.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 3965462..1455e8e 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py @@ -61,6 +61,15 @@ class Konsole(XTerminal): command = 'konsole -T "{title}" -e {command}' priority = 2 + def __init__(self, command, title=None, env=None): + # Check version + vernum = check_konsole_version("konsole") + if vernum: + if vernum.split('.')[0] == "2": + logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping') + raise UnsupportedTerminal(self.name) + XTerminal.__init__(self, command, title, env) + class XTerm(XTerminal): command = 'xterm -T "{title}" -e {command}' priority = 1 @@ -104,3 +113,21 @@ def spawn(name, command, title=None, env=None): output = pipe.communicate()[0] if pipe.returncode != 0: raise ExecutionError(pipe.command, pipe.returncode, output) + +def check_konsole_version(konsole): + import subprocess as sub + try: + p = sub.Popen(['sh', '-c', '%s --version' % konsole],stdout=sub.PIPE,stderr=sub.PIPE) + out, err = p.communicate() + ver_info = out.rstrip().split('\n') + except OSError as exc: + import errno + if exc.errno == errno.ENOENT: + return None + else: + raise + vernum = None + for ver in ver_info: + if ver.startswith('Konsole'): + vernum = ver.split(' ')[-1] + return vernum |