[U-Boot] [PATCH] buildman: allow multiple toolchains in a single path

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 albert.u.boot@aribaud.net --- tools/buildman/toolchain.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index d4c5d4a..537797a 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -197,13 +197,14 @@ class Toolchains: 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): @@ -219,8 +220,8 @@ class Toolchains: 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):

On 31 January 2015 at 16:12, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
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 albert.u.boot@aribaud.net
tools/buildman/toolchain.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Acked-by: Simon Glass sjg@chromium.org

On 15 February 2015 at 14:31, Simon Glass sjg@chromium.org wrote:
On 31 January 2015 at 16:12, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
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 albert.u.boot@aribaud.net
tools/buildman/toolchain.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Acked-by: Simon Glass sjg@chromium.org
Applied to u-boot-x86/sandbox.
participants (2)
-
Albert ARIBAUD
-
Simon Glass