diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-26 16:31:17 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-29 23:07:13 +0000 |
commit | f0627490711f29f0e308a0afc4fc4f8e54f58dec (patch) | |
tree | f49726d00a0643813151df56f386efa4665be926 /meta/lib/oe | |
parent | 1dbcdfcdf8dd367b0b0440ba8ea7b79ac85a1a37 (diff) | |
download | poky-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')
-rw-r--r-- | meta/lib/oe/distro_check.py | 2 | ||||
-rw-r--r-- | meta/lib/oe/terminal.py | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py index 88e46c354d..4b2a9bec01 100644 --- a/meta/lib/oe/distro_check.py +++ b/meta/lib/oe/distro_check.py | |||
@@ -26,7 +26,7 @@ def find_latest_numeric_release(url, d): | |||
26 | maxstr="" | 26 | maxstr="" |
27 | for link in get_links_from_url(url, d): | 27 | for link in get_links_from_url(url, d): |
28 | try: | 28 | try: |
29 | # TODO use LooseVersion | 29 | # TODO use bb.utils.vercmp_string_op() |
30 | release = float(link) | 30 | release = float(link) |
31 | except: | 31 | except: |
32 | release = 0 | 32 | release = 0 |
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 | |||
5 | import oe.classutils | 5 | import oe.classutils |
6 | import shlex | 6 | import shlex |
7 | from bb.process import Popen, ExecutionError | 7 | from bb.process import Popen, ExecutionError |
8 | from distutils.version import LooseVersion | ||
9 | 8 | ||
10 | logger = logging.getLogger('BitBake.OE.Terminal') | 9 | logger = 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 | ||
261 | def check_tmux_version(desired): | 260 | def 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 | ||