[U-Boot] [PATCH v3 10/10] moveconfig: Add a switch to only cleanup headers

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


In some case you may want to only cleanup the headers. Make it possible
without waiting for all boards to compile.

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

---

Changes in v3:
-New for version 3

Changes in v2: None

 tools/moveconfig.py | 83 ++++++++++++++++++++++++++++-------------------------
 1 file changed, 44 insertions(+), 39 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index bb087d4..d63f47f 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -412,48 +412,50 @@ class Slots:
 def move_config(config_attrs, options):
     check_top_directory()
 
-    for config_attr in config_attrs:
-        print 'Moving %s (type: %s, default: %s, no_spl: %s)' % (
-            config_attr['config'],
-            config_attr['type'],
-            config_attr['default'],
-            config_attr['no_spl_support'])
-    print '%d jobs...' % options.jobs
-
-    if options.defconfigs:
-        defconfigs = [line.strip() for line in open(options.defconfigs, 'r')]
-    else:
-        # All the defconfig files to be processed
-        defconfigs = []
-        for (dirpath, dirnames, filenames) in os.walk('configs'):
-            dirpath = dirpath[len('configs') + 1:]
-            for filename in fnmatch.filter(filenames, '*_defconfig'):
-                if fnmatch.fnmatch(filename, '.*'):
-                    continue
-                defconfigs.append(os.path.join(dirpath, filename))
-
-    """Clean up any previous log of failed moves"""
-    if os.path.exists('moveconfig.failed'):
-        os.remove('moveconfig.failed')
-
-    slots = Slots(config_attrs, options)
-
-    # Main loop to process defconfig files:
-    #  Add a new subprocess into a vacant slot.
-    #  Sleep if there is no available slot.
-    for i, defconfig in enumerate(defconfigs):
-        while not slots.add(defconfig, i, len(defconfigs)):
-            while not slots.available():
-                # No available slot: sleep for a while
-                time.sleep(SLEEP_TIME)
-
-    # wait until all the subprocesses finish
-    while not slots.empty():
-        time.sleep(SLEEP_TIME)
+    if not options.clean_only:
+        for config_attr in config_attrs:
+            print 'Moving %s (type: %s, default: %s, no_spl: %s)' % (
+                config_attr['config'],
+                config_attr['type'],
+                config_attr['default'],
+                config_attr['no_spl_support'])
+        print '%d jobs...' % options.jobs
+
+        if options.defconfigs:
+            defconfigs = [line.strip() for line in
+                open(options.defconfigs, 'r')]
+        else:
+            # All the defconfig files to be processed
+            defconfigs = []
+            for (dirpath, dirnames, filenames) in os.walk('configs'):
+                dirpath = dirpath[len('configs') + 1:]
+                for filename in fnmatch.filter(filenames, '*_defconfig'):
+                    if fnmatch.fnmatch(filename, '.*'):
+                        continue
+                    defconfigs.append(os.path.join(dirpath, filename))
+
+        """Clean up any previous log of failed moves"""
+        if os.path.exists('moveconfig.failed'):
+            os.remove('moveconfig.failed')
+
+        slots = Slots(config_attrs, options)
+
+        # Main loop to process defconfig files:
+        #  Add a new subprocess into a vacant slot.
+        #  Sleep if there is no available slot.
+        for i, defconfig in enumerate(defconfigs):
+            while not slots.add(defconfig, i, len(defconfigs)):
+                while not slots.available():
+                    # No available slot: sleep for a while
+                    time.sleep(SLEEP_TIME)
+
+        # wait until all the subprocesses finish
+        while not slots.empty():
+            time.sleep(SLEEP_TIME)
 
     cleanup_headers(config_attrs)
 
-    if os.path.exists('moveconfig.failed'):
+    if (not options.clean_only) & os.path.exists('moveconfig.failed'):
         print '!!!  Some boards were not processed; move the config manually.'
         print '!!!  The list of failed boards are saved in moveconfig.failed'
         print
@@ -467,6 +469,9 @@ def main():
 
     parser = optparse.OptionParser()
     # Add options here
+    parser.add_option('-c', '--clean-only', dest='clean_only',
+                      action='store_true', default=False,
+                      help='only clean the headers')
     parser.add_option('-d', '--defconfigs', type='string',
                       help='a file containing a list of defconfigs to move')
     parser.add_option('-j', '--jobs', type='int', default=cpu_count,
-- 
1.7.11.5



More information about the U-Boot mailing list