1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

fw/resource: Support matching APKs on multiple versions.

In the case where a range of apk versions are valid allow for the matching
process to accommodate a list of versions instead of a single value.
This commit is contained in:
Marc Bonnici 2019-01-04 17:23:08 +00:00 committed by setrofim
parent f267fc9277
commit 0cba3c68dc

View File

@ -273,10 +273,14 @@ class ResourceResolver(object):
def apk_version_matches(path, version): def apk_version_matches(path, version):
version = list_or_string(version)
info = ApkInfo(path) info = ApkInfo(path)
if info.version_name == version or info.version_code == version: for v in version:
return True if info.version_name == v or info.version_code == v:
return loose_version_matching(version, info.version_name) return True
if loose_version_matching(v, info.version_name):
return True
return False
def loose_version_matching(config_version, apk_version): def loose_version_matching(config_version, apk_version):