buildman: Correct toolchain download feature
authorSimon Glass <sjg@chromium.org>
Tue, 3 Mar 2015 00:05:15 +0000 (17:05 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 5 Mar 2015 23:14:01 +0000 (16:14 -0700)
Commit d908898 updated the ScanPath() function but not its documentation
and not all its callers.

This breaks the toolchain check after it is downloaded. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
tools/buildman/toolchain.py

index 537797a..051da11 100644 (file)
@@ -465,11 +465,15 @@ class Toolchains:
         # Check that the toolchain works
         print 'Testing'
         dirpath = os.path.join(dest, path)
-        compiler_fname = self.ScanPath(dirpath, True)
-        if not compiler_fname:
+        compiler_fname_list = self.ScanPath(dirpath, True)
+        if not compiler_fname_list:
             print 'Could not locate C compiler - fetch failed.'
             return 1
-        toolchain = Toolchain(compiler_fname, True, True)
+        if len(compiler_fname_list) != 1:
+            print ('Internal error, ambiguous toolchains: %s' %
+                   (', '.join(compiler_fname)))
+            return 1
+        toolchain = Toolchain(compiler_fname_list[0], True, True)
 
         # Make sure that it will be found by buildman
         if not self.TestSettingsHasPath(dirpath):