1
0
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:
Sebastian Goscik 2016-02-15 15:11:38 +00:00
parent 84151f953a
commit be8f972f60

View File

@ -437,6 +437,14 @@ class Target(object):
which = get_installed 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): def is_installed(self, name):
return bool(self.get_installed(name)) return bool(self.get_installed(name))