summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/terminal.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-26 16:31:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-29 23:07:13 +0000
commitf0627490711f29f0e308a0afc4fc4f8e54f58dec (patch)
treef49726d00a0643813151df56f386efa4665be926 /meta/lib/oe/terminal.py
parent1dbcdfcdf8dd367b0b0440ba8ea7b79ac85a1a37 (diff)
downloadpoky-f0627490711f29f0e308a0afc4fc4f8e54f58dec.tar.gz
sanity/lib: Replace usage of LooseVersion() with bb.utils.vercmp_string_op()
distutils is going away and we have functionality in bitbake which can handle these comparisions so switch to the bb.utils function. (From OE-Core rev: fe624b520e6c75e16a8f394785ab0216341402f9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/terminal.py')
-rw-r--r--meta/lib/oe/terminal.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 59aa80de66..53186c4a3e 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -5,7 +5,6 @@ import logging
5import oe.classutils 5import oe.classutils
6import shlex 6import shlex
7from bb.process import Popen, ExecutionError 7from bb.process import Popen, ExecutionError
8from distutils.version import LooseVersion
9 8
10logger = logging.getLogger('BitBake.OE.Terminal') 9logger = logging.getLogger('BitBake.OE.Terminal')
11 10
@@ -86,10 +85,10 @@ class Konsole(XTerminal):
86 def __init__(self, sh_cmd, title=None, env=None, d=None): 85 def __init__(self, sh_cmd, title=None, env=None, d=None):
87 # Check version 86 # Check version
88 vernum = check_terminal_version("konsole") 87 vernum = check_terminal_version("konsole")
89 if vernum and LooseVersion(vernum) < '2.0.0': 88 if vernum and bb.utils.vercmp_string_op(vernum, "2.0.0", "<"):
90 # Konsole from KDE 3.x 89 # Konsole from KDE 3.x
91 self.command = 'konsole -T "{title}" -e {command}' 90 self.command = 'konsole -T "{title}" -e {command}'
92 elif vernum and LooseVersion(vernum) < '16.08.1': 91 elif vernum and bb.utils.vercmp_string_op(vernum, "16.08.1", "<"):
93 # Konsole pre 16.08.01 Has nofork 92 # Konsole pre 16.08.01 Has nofork
94 self.command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}' 93 self.command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}'
95 XTerminal.__init__(self, sh_cmd, title, env, d) 94 XTerminal.__init__(self, sh_cmd, title, env, d)
@@ -260,7 +259,7 @@ def spawn(name, sh_cmd, title=None, env=None, d=None):
260 259
261def check_tmux_version(desired): 260def check_tmux_version(desired):
262 vernum = check_terminal_version("tmux") 261 vernum = check_terminal_version("tmux")
263 if vernum and LooseVersion(vernum) < desired: 262 if vernum and bb.utils.vercmp_string_op(vernum, desired, "<"):
264 return False 263 return False
265 return vernum 264 return vernum
266 265