Skip to content

Commit

Permalink
buildman: allow multiple toolchains in a single path
Browse files Browse the repository at this point in the history
When buildman scans a toolchain path, it stops at the
first toolchain found. However, a single path can contains
several toolchains, each with its own prefix.

This patch lets buildman scan all toolchains in the path.

Signed-off-by: Albert ARIBAUD <[email protected]>
Acked-by: Simon Glass <[email protected]>
  • Loading branch information
albert-aribaud-u-boot authored and sjg20 committed Feb 15, 2015
1 parent 8895b3e commit d908898
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/buildman/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,14 @@ def ScanPath(self, path, verbose):
Returns:
Filename of C compiler if found, else None
"""
fnames = []
for subdir in ['.', 'bin', 'usr/bin']:
dirname = os.path.join(path, subdir)
if verbose: print " - looking in '%s'" % dirname
for fname in glob.glob(dirname + '/*gcc'):
if verbose: print " - found '%s'" % fname
return fname
return None
fnames.append(fname)
return fnames


def Scan(self, verbose):
Expand All @@ -219,8 +220,8 @@ def Scan(self, verbose):
if verbose: print 'Scanning for tool chains'
for path in self.paths:
if verbose: print " - scanning path '%s'" % path
fname = self.ScanPath(path, verbose)
if fname:
fnames = self.ScanPath(path, verbose)
for fname in fnames:
self.Add(fname, True, verbose)

def List(self):
Expand Down

0 comments on commit d908898

Please sign in to comment.