mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
Target: Added install_if_needed method
This method will first search the target for a binary, only installing it, if one was not found.
This commit is contained in:
parent
84151f953a
commit
be8f972f60
@ -437,6 +437,14 @@ class Target(object):
|
||||
|
||||
which = get_installed
|
||||
|
||||
def install_if_needed(self, host_path, search_system_binaries=True):
|
||||
|
||||
binary_path = self.get_installed(os.path.split(host_path)[1],
|
||||
search_system_binaries=search_system_binaries)
|
||||
if not binary_path:
|
||||
binary_path = self.install(host_path)
|
||||
return binary_path
|
||||
|
||||
def is_installed(self, name):
|
||||
return bool(self.get_installed(name))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user