forked from OSchip/llvm-project
lit/LitConfig.py: Add the new method getToolsPath(dir,paths,tools).
It seeks tools(eg. [cmp, grep, sed]) in same directory, to be sane. It seeks "bash" only in the directory found at last time. Or bash would be insane (against other tools). llvm-svn: 125175
This commit is contained in:
parent
b5c0b4667e
commit
edfec9d04b
|
@ -85,6 +85,22 @@ class LitConfig:
|
||||||
|
|
||||||
return self.bashPath
|
return self.bashPath
|
||||||
|
|
||||||
|
def getToolsPath(self, dir, paths, tools):
|
||||||
|
import os, Util
|
||||||
|
if dir is not None and os.path.isabs(dir) and os.path.isdir(dir):
|
||||||
|
if not Util.checkToolsPath(dir, tools):
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
dir = Util.whichTools(tools, paths)
|
||||||
|
|
||||||
|
# bash
|
||||||
|
self.bashPath = Util.which('bash', dir)
|
||||||
|
if self.bashPath is None:
|
||||||
|
self.warning("Unable to find 'bash.exe'.")
|
||||||
|
self.bashPath = ''
|
||||||
|
|
||||||
|
return dir
|
||||||
|
|
||||||
def _write_message(self, kind, message):
|
def _write_message(self, kind, message):
|
||||||
import inspect, os, sys
|
import inspect, os, sys
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue