summaryrefslogtreecommitdiffstats
path: root/tools/cr/cr/base/host.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cr/cr/base/host.py')
-rw-r--r--tools/cr/cr/base/host.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/cr/cr/base/host.py b/tools/cr/cr/base/host.py
index 30ce785..f60b55b5 100644
--- a/tools/cr/cr/base/host.py
+++ b/tools/cr/cr/base/host.py
@@ -159,7 +159,7 @@ class Host(cr.Plugin, cr.Plugin.Type):
return result in ['y', 'yes']
@classmethod
- def SearchPath(cls, name):
+ def SearchPath(cls, name, paths=[]):
"""Searches the PATH for an executable.
Args:
@@ -170,7 +170,9 @@ class Host(cr.Plugin, cr.Plugin.Type):
result = []
extensions = ['']
extensions.extend(os.environ.get('PATHEXT', '').split(os.pathsep))
- for path in os.environ.get('PATH', '').split(os.pathsep):
+ paths = [cr.context.Substitute(path) for path in paths if path]
+ paths = paths + os.environ.get('PATH', '').split(os.pathsep)
+ for path in paths:
partial = os.path.join(path, name)
for extension in extensions:
filename = partial + extension