diff options
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/terminal.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 01c0ccc334..fdfdde2f91 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py | |||
@@ -2,6 +2,7 @@ import logging | |||
2 | import oe.classutils | 2 | import oe.classutils |
3 | import shlex | 3 | import shlex |
4 | from bb.process import Popen, ExecutionError | 4 | from bb.process import Popen, ExecutionError |
5 | from distutils.version import LooseVersion | ||
5 | 6 | ||
6 | logger = logging.getLogger('BitBake.OE.Terminal') | 7 | logger = logging.getLogger('BitBake.OE.Terminal') |
7 | 8 | ||
@@ -57,9 +58,9 @@ class Gnome(XTerminal): | |||
57 | 58 | ||
58 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 59 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
59 | # Check version | 60 | # Check version |
60 | (major, minor) = check_terminal_version("gnome-terminal") | 61 | vernum = check_terminal_version("gnome-terminal") |
61 | if major >= 3 and minor >= 10: | 62 | if vernum and LooseVersion(vernum) >= '3.10': |
62 | logger.warn(1, 'Gnome-Terminal >3.10 does not support --disable-factory') | 63 | logger.debug(1, 'Gnome-Terminal 3.10 or later does not support --disable-factory') |
63 | self.command = 'gnome-terminal -t "{title}" -x {command}' | 64 | self.command = 'gnome-terminal -t "{title}" -x {command}' |
64 | XTerminal.__init__(self, sh_cmd, title, env, d) | 65 | XTerminal.__init__(self, sh_cmd, title, env, d) |
65 | 66 | ||
@@ -81,8 +82,8 @@ class Konsole(XTerminal): | |||
81 | 82 | ||
82 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 83 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
83 | # Check version | 84 | # Check version |
84 | (major, minor) = check_terminal_version("konsole") | 85 | vernum = check_terminal_version("konsole") |
85 | if major == 2: | 86 | if vernum and LooseVersion(vernum) >= '2.0.0': |
86 | logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping') | 87 | logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping') |
87 | raise UnsupportedTerminal(self.name) | 88 | raise UnsupportedTerminal(self.name) |
88 | XTerminal.__init__(self, sh_cmd, title, env, d) | 89 | XTerminal.__init__(self, sh_cmd, title, env, d) |
@@ -239,17 +240,12 @@ def check_terminal_version(terminalName): | |||
239 | else: | 240 | else: |
240 | raise | 241 | raise |
241 | vernum = None | 242 | vernum = None |
242 | major = int(0) | ||
243 | minor = int(0) | ||
244 | for ver in ver_info: | 243 | for ver in ver_info: |
245 | if ver.startswith('Konsole'): | 244 | if ver.startswith('Konsole'): |
246 | vernum = ver.split(' ')[-1] | 245 | vernum = ver.split(' ')[-1] |
247 | if ver.startswith('GNOME Terminal'): | 246 | if ver.startswith('GNOME Terminal'): |
248 | vernum = ver.split(' ')[-1] | 247 | vernum = ver.split(' ')[-1] |
249 | if vernum: | 248 | return vernum |
250 | major = int(vernum.split('.')[0]) | ||
251 | minor = int(vernum.split('.')[1]) | ||
252 | return major, minor | ||
253 | 249 | ||
254 | def distro_name(): | 250 | def distro_name(): |
255 | try: | 251 | try: |