tests: handle - in the sfdisk version test

When a `-` is in the version (meaning a version such as: `2.38-rc1`),
take only the part before the dash.

This closes #1036.
This commit is contained in:
Simon de Vlieger 2022-05-30 11:25:52 +02:00 committed by Christian Kellner
parent 16b187f5d9
commit ce9253788e

View file

@ -33,6 +33,10 @@ def have_sfdisk_with_json():
data = r.stdout.strip()
vstr = data.split(" ")[-1]
if "-" in vstr:
vstr = vstr.split("-")[0]
ver = list(map(int, vstr.split(".")))
return ver[0] >= 2 and ver[1] >= 27