mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-28 06:58:19 +00:00
lit/Util.py: Add two functions, checkToolsPath(dir,tools) and whichTools(tools,paths).
checkToolsPath(dir,tools): return True if "dir" contains all "tools". whichTools(tools,paths): return a directory that contains all "tools" in "paths". Or return None when all "tools" were not met. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125174 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b656a11c70
commit
df944f1f83
@ -75,6 +75,18 @@ def which(command, paths = None):
|
||||
|
||||
return None
|
||||
|
||||
def checkToolsPath(dir, tools):
|
||||
for tool in tools:
|
||||
if not os.path.exists(os.path.join(dir, tool)):
|
||||
return False;
|
||||
return True;
|
||||
|
||||
def whichTools(tools, paths):
|
||||
for path in paths.split(os.pathsep):
|
||||
if checkToolsPath(path, tools):
|
||||
return path
|
||||
return None
|
||||
|
||||
def printHistogram(items, title = 'Items'):
|
||||
import itertools, math
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user