mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-29 15:43:44 +08:00
test/py: Improve check for mksquashfs version
Some builds of squashfs-tools append version string with "-git" or similar. The float() conversion will fail in this case. Improve the code to only convert to float() the string before the '-' character. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
This commit is contained in:
parent
ff7852d544
commit
89795ef3b6
@ -146,7 +146,7 @@ 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])
|
||||
return float(out.stdout.split()[2].split('-')[0])
|
||||
|
||||
def check_mksquashfs_version():
|
||||
""" Checks if mksquashfs meets the required version. """
|
||||
|
Loading…
Reference in New Issue
Block a user