From patchwork Wed May 13 22:28:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Hershberger X-Patchwork-Id: 472136 X-Patchwork-Delegate: yamada.m@jp.panasonic.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 42ECD140283 for ; Thu, 14 May 2015 08:32:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BADB34B6B3; Thu, 14 May 2015 00:32:31 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RAxgtm3u_-Vl; Thu, 14 May 2015 00:32:31 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C7F34B686; Thu, 14 May 2015 00:32:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CCEF54B61F for ; Thu, 14 May 2015 00:31:16 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9_vhloR91pcr for ; Thu, 14 May 2015 00:31:16 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from ni.com (skprod3.natinst.com [130.164.80.24]) by theia.denx.de (Postfix) with ESMTPS id 26CA14B622 for ; Thu, 14 May 2015 00:31:13 +0200 (CEST) Received: from us-aus-mgwout1.amer.corp.natinst.com (nb-snip2-1338.natinst.com [130.164.19.135]) by us-aus-skprod3.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id t4DMVBfr032664; Wed, 13 May 2015 17:31:11 -0500 Received: from linux-xvxi.natinst.com ([130.164.14.198]) by us-aus-mgwout1.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP6) with ESMTP id 2015051317311155-1434854 ; Wed, 13 May 2015 17:31:11 -0500 From: Joe Hershberger To: u-boot@lists.denx.de Date: Wed, 13 May 2015 17:28:56 -0500 Message-Id: <1431556137-8426-10-git-send-email-joe.hershberger@ni.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1431556137-8426-1-git-send-email-joe.hershberger@ni.com> References: <1431364998-2905-1-git-send-email-joe.hershberger@ni.com> <1431556137-8426-1-git-send-email-joe.hershberger@ni.com> X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 05/13/2015 05:31:11 PM, Serialize by Router on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 05/13/2015 05:31:11 PM, Serialize complete at 05/13/2015 05:31:11 PM X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2015-05-13_07:, , signatures=0 Cc: Joe Hershberger Subject: [U-Boot] [PATCH v3 10/10] moveconfig: Add a switch to only cleanup headers X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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,