[U-Boot] [PATCH v3 06/10] moveconfig: Add a switch to enable printing errors

Joe Hershberger joe.hershberger at ni.com
Thu May 14 00:28:52 CEST 2015


In some cases the build for the autoconf breaks. This outputs the errors
following the status so that action can be taken without building again
manually.

Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>

---

Changes in v3: None
Changes in v2:
-New for version 2

 tools/moveconfig.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 2688ad1..9135e1d 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -241,7 +241,7 @@ class Slot:
     for faster processing.
     """
 
-    def __init__(self, config_attr, devnull, make_cmd):
+    def __init__(self, config_attr, devnull, make_cmd, options):
         """Create a new slot.
 
         Arguments:
@@ -250,6 +250,7 @@ class Slot:
         self.build_dir = tempfile.mkdtemp()
         self.devnull = devnull
         self.make_cmd = (make_cmd, 'O=' + self.build_dir)
+        self.options = options
         self.parser = KconfigParser(self.build_dir, config_attr)
         self.state = STATE_IDLE
 
@@ -307,6 +308,8 @@ class Slot:
             if errout.find('gcc: command not found') != -1:
                 errmsg = 'ERROR - compiler not found (%s)' % self.cross_compile
             self.defconfig_error(errmsg)
+            if self.options.verbose:
+                print errout
             self.state = STATE_IDLE
             return True
 
@@ -346,7 +349,7 @@ class Slots:
 
     """Controller of the array of subprocess slots."""
 
-    def __init__(self, config_attr, jobs):
+    def __init__(self, config_attr, options):
         """Create a new slots controller.
 
         Arguments:
@@ -355,8 +358,8 @@ class Slots:
         self.slots = []
         devnull = get_devnull()
         make_cmd = get_make_cmd()
-        for i in range(jobs):
-            self.slots.append(Slot(config_attr, devnull, make_cmd))
+        for i in range(options.jobs):
+            self.slots.append(Slot(config_attr, devnull, make_cmd, options))
 
     def add(self, defconfig):
         """Add a new subprocess if a vacant slot is available.
@@ -422,7 +425,7 @@ def move_config(config_attr, options):
     if os.path.exists('moveconfig.failed'):
         os.remove('moveconfig.failed')
 
-    slots = Slots(config_attr, options.jobs)
+    slots = Slots(config_attr, options)
 
     # Main loop to process defconfig files:
     #  Add a new subprocess into a vacant slot.
@@ -457,6 +460,9 @@ def main():
                       help='a file containing a list of defconfigs to move')
     parser.add_option('-j', '--jobs', type='int', default=cpu_count,
                       help='the number of jobs to run simultaneously')
+    parser.add_option('-v', '--verbose', dest='verbose',
+                      action='store_true', default=False,
+                      help='show any build errors as boards are build')
     parser.usage += ' config type default no_spl_support'
     (options, args) = parser.parse_args()
 
-- 
1.7.11.5



More information about the U-Boot mailing list