mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
fw/getters: update Executable resolution
Use Executable.match() rather than just checking the path inside get_from_location(); this allows for alternative matching semantics (e.g. globbing) inside derived implementations.
This commit is contained in:
parent
05857ec2bc
commit
24a4a032db
@ -84,9 +84,13 @@ def get_from_location(basepath, resource):
|
|||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
return path
|
return path
|
||||||
elif resource.kind == 'executable':
|
elif resource.kind == 'executable':
|
||||||
path = os.path.join(basepath, 'bin', resource.abi, resource.filename)
|
bin_dir = os.path.join(basepath, 'bin', resource.abi)
|
||||||
if os.path.exists(path):
|
if not os.path.exists(bin_dir):
|
||||||
return path
|
return None
|
||||||
|
for entry in os.listdir(bin_dir):
|
||||||
|
path = os.path.join(bin_dir, entry)
|
||||||
|
if resource.match(path):
|
||||||
|
return path
|
||||||
elif resource.kind == 'revent':
|
elif resource.kind == 'revent':
|
||||||
path = os.path.join(basepath, 'revent_files')
|
path = os.path.join(basepath, 'revent_files')
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user