From f0627490711f29f0e308a0afc4fc4f8e54f58dec Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 26 Nov 2021 16:31:17 +0000 Subject: 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 --- meta/lib/oe/terminal.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'meta/lib/oe/terminal.py') 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 import oe.classutils import shlex from bb.process import Popen, ExecutionError -from distutils.version import LooseVersion logger = logging.getLogger('BitBake.OE.Terminal') @@ -86,10 +85,10 @@ class Konsole(XTerminal): def __init__(self, sh_cmd, title=None, env=None, d=None): # Check version vernum = check_terminal_version("konsole") - if vernum and LooseVersion(vernum) < '2.0.0': + if vernum and bb.utils.vercmp_string_op(vernum, "2.0.0", "<"): # Konsole from KDE 3.x self.command = 'konsole -T "{title}" -e {command}' - elif vernum and LooseVersion(vernum) < '16.08.1': + elif vernum and bb.utils.vercmp_string_op(vernum, "16.08.1", "<"): # Konsole pre 16.08.01 Has nofork self.command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}' XTerminal.__init__(self, sh_cmd, title, env, d) @@ -260,7 +259,7 @@ def spawn(name, sh_cmd, title=None, env=None, d=None): def check_tmux_version(desired): vernum = check_terminal_version("tmux") - if vernum and LooseVersion(vernum) < desired: + if vernum and bb.utils.vercmp_string_op(vernum, desired, "<"): return False return vernum -- cgit v1.2.3-54-g00ecf