提交 d051a91c 编写于 作者: H Heinrich Schuchardt 提交者: Tom Rini

test: fix parsing the mksquashfs version number

Testing with mksquasshfs 4.5.1 results in an error

    ValueError: could not convert string to float: '4.5.1'

Version 4.10 would be considered to be lower than 4.4.

Fixes: 04c9813e ("test/py: rewrite common tools for SquashFS tests")
Signed-off-by: NHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
上级 d9402bd4
......@@ -146,15 +146,14 @@ def get_mksquashfs_version():
out = subprocess.run(['mksquashfs -version'], shell=True, check=True,
capture_output=True, text=True)
# 'out' is: mksquashfs version X (yyyy/mm/dd) ...
return float(out.stdout.split()[2].split('-')[0])
return out.stdout.split()[2].split('.')[0:2]
def check_mksquashfs_version():
""" Checks if mksquashfs meets the required version. """
required_version = 4.4
if get_mksquashfs_version() < required_version:
print('Error: mksquashfs is too old.')
print('Required version: {}'.format(required_version))
version = get_mksquashfs_version();
if int(version[0]) < 4 or int(version[0]) == 4 and int(version[1]) < 4 :
print('Error: mksquashfs is too old, required version: 4.4')
raise AssertionError
def make_all_images(build_dir):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册