1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 02:01:16 +00:00

utils/types: Update version_tuple to allow splitting on "-"

Some Apks use "-" characters to separate their version and identifier so
treat as a separator value.
This commit is contained in:
Marc Bonnici 2020-01-14 13:07:31 +00:00
parent 164095e664
commit 39a294ddbe

View File

@ -211,8 +211,10 @@ def regex(value):
def version_tuple(v):
"""
Converts a version string into a tuple of strings that can be used for natural comparison.
Converts a version string into a tuple of strings that can be used for
natural comparison allowing delimeters of "-" and ".".
"""
v = v.replace('-', '.')
return tuple(map(str, (v.split("."))))