Skip to contentSkip to conversation

buildman: allow multiple toolchains in a single path

PATCH New Albert ARIBAUD 2 participants 3 messages Jan 31, 2015 – Feb 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 tools/buildman/toolchain.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
tools/buildman/toolchain.py +5 -4
index d4c5d4a..537797a 100644
@@ -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):
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 buildman: allow multiple toolchains in a single path

Quoted 10 lines · Albert ARIBAUD

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.

---
 tools/buildman/toolchain.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
#2 lore raw

PATCH 1/1 buildman: allow multiple toolchains in a single path

Quoted 5 lines · Simon Glass
Quoted 4 lines · Albert ARIBAUD

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.

Quoted 8 lines
Quoted 6 lines

This patch lets buildman scan all toolchains in the path.

---
 tools/buildman/toolchain.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Applied to u-boot-x86/sandbox.