buildman: Correct logic for adding a toolchain
authorSimon Glass <sjg@chromium.org>
Fri, 8 Nov 2024 15:23:47 +0000 (08:23 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 19 Nov 2024 16:04:47 +0000 (10:04 -0600)
If the toolchain is bad, it should not be added. Correct the logic for
this.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/toolchain.py

index 0c8a4fa16eb96e807e821b92082ecfc44c1f8085..dab350fec313fc1357a59c7d35dbfdb3e9efdb27 100644 (file)
@@ -327,16 +327,17 @@ class Toolchains:
         toolchain = Toolchain(fname, test, verbose, priority, arch,
                               self.override_toolchain)
         add_it = toolchain.ok
-        if toolchain.arch in self.toolchains:
-            add_it = (toolchain.priority <
-                        self.toolchains[toolchain.arch].priority)
         if add_it:
-            self.toolchains[toolchain.arch] = toolchain
-        elif verbose:
-            print(("Toolchain '%s' at priority %d will be ignored because "
-                   "another toolchain for arch '%s' has priority %d" %
-                   (toolchain.gcc, toolchain.priority, toolchain.arch,
-                    self.toolchains[toolchain.arch].priority)))
+            if toolchain.arch in self.toolchains:
+                add_it = (toolchain.priority <
+                          self.toolchains[toolchain.arch].priority)
+            if add_it:
+                self.toolchains[toolchain.arch] = toolchain
+            elif verbose:
+                print(("Toolchain '%s' at priority %d will be ignored because "
+                       "another toolchain for arch '%s' has priority %d" %
+                       (toolchain.gcc, toolchain.priority, toolchain.arch,
+                        self.toolchains[toolchain.arch].priority)))
 
     def ScanPath(self, path, verbose):
         """Scan a path for a valid toolchain
This page took 0.042283 seconds and 4 git commands to generate.