diff mbox

[U-Boot,04/11] buildman: Allow the toolchain error to be suppressed

Message ID 1467580467-19186-5-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 3, 2016, 9:14 p.m. UTC
When there are no toolchains a warning is printed. But in some cases this is
confusing, such as when the user is fetching new toolchains.

Adjust the function to supress the warning in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

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

Comments

Stephen Warren July 7, 2016, 6:17 p.m. UTC | #1
On 07/03/2016 03:14 PM, Simon Glass wrote:
> When there are no toolchains a warning is printed. But in some cases this is
> confusing, such as when the user is fetching new toolchains.
>
> Adjust the function to supress the warning in this case.

> diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py

> -    def GetPathList(self):
> +    def GetPathList(self, show_warning=True):
>           """Get a list of available toolchain paths
>
> +        Args:
> +            show_warning: True to show a warning if there are no tool chains.

I don't see the new parameter being used anywhere?
diff mbox

Patch

diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index 3993db3..f6ab295 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -167,9 +167,12 @@  class Toolchains:
         self.paths = []
         self._make_flags = dict(bsettings.GetItems('make-flags'))
 
-    def GetPathList(self):
+    def GetPathList(self, show_warning=True):
         """Get a list of available toolchain paths
 
+        Args:
+            show_warning: True to show a warning if there are no tool chains.
+
         Returns:
             List of strings, each a path to a toolchain mentioned in the
             [toolchain] section of the settings file.
@@ -188,9 +191,14 @@  class Toolchains:
                 paths.append(value)
         return paths
 
-    def GetSettings(self):
-      self.prefixes = bsettings.GetItems('toolchain-prefix')
-      self.paths += self.GetPathList()
+    def GetSettings(self, show_warning=True):
+        """Get toolchain settings from the settings file.
+
+        Args:
+            show_warning: True to show a warning if there are no tool chains.
+        """
+        self.prefixes = bsettings.GetItems('toolchain-prefix')
+        self.paths += self.GetPathList(show_warning)
 
     def Add(self, fname, test=True, verbose=False, priority=PRIORITY_CALC,
             arch=None):
@@ -479,7 +487,7 @@  class Toolchains:
         Returns:
             True if the path is in settings, False if not
         """
-        paths = self.GetPathList()
+        paths = self.GetPathList(False)
         return path in paths
 
     def ListArchs(self):