From patchwork Wed May 13 22:28:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Hershberger X-Patchwork-Id: 472128 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 BC6A21401B5 for ; Thu, 14 May 2015 08:31:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C744D4B62C; Thu, 14 May 2015 00:31:26 +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 rY8iiO51EqC0; Thu, 14 May 2015 00:31:26 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 912E44B61D; Thu, 14 May 2015 00:31:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AED384B61F for ; Thu, 14 May 2015 00:31:13 +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 K5j_jB4jq-8T for ; Thu, 14 May 2015 00:31:13 +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 (skprod2.natinst.com [130.164.80.23]) by theia.denx.de (Postfix) with ESMTPS id 3D4724B617 for ; Thu, 14 May 2015 00:31:10 +0200 (CEST) Received: from us-aus-mgwout1.amer.corp.natinst.com (nb-chan1-1338.natinst.com [130.164.19.134]) by us-aus-skprod2.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id t4DMV8tF017527; Wed, 13 May 2015 17:31:08 -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 2015051317310899-1434841 ; Wed, 13 May 2015 17:31:08 -0500 From: Joe Hershberger To: u-boot@lists.denx.de Date: Wed, 13 May 2015 17:28:51 -0500 Message-Id: <1431556137-8426-5-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:08 PM, Serialize by Router on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 05/13/2015 05:31:09 PM, Serialize complete at 05/13/2015 05:31:09 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 05/10] moveconfig: Add a parameter to accept a list to build 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" This is helpful to re-attempt to move failed boards from a previous run without starting over. Signed-off-by: Joe Hershberger --- Changes in v3: -Fixed command line options order (alphabetize) Changes in v2: -New for version 2 tools/moveconfig.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index f2651a9..2688ad1 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -396,7 +396,7 @@ class Slots: ret = False return ret -def move_config(config_attr, jobs=1): +def move_config(config_attr, options): check_top_directory() print 'Moving %s (type: %s, default: %s, no_spl: %s) ... (jobs: %d)' % ( @@ -404,22 +404,25 @@ def move_config(config_attr, jobs=1): config_attr['type'], config_attr['default'], config_attr['no_spl_support'], - jobs) - - # 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)) + 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_attr, jobs) + slots = Slots(config_attr, options.jobs) # Main loop to process defconfig files: # Add a new subprocess into a vacant slot. @@ -450,6 +453,8 @@ def main(): parser = optparse.OptionParser() # Add options here + 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, help='the number of jobs to run simultaneously') parser.usage += ' config type default no_spl_support' @@ -480,7 +485,7 @@ def main(): if not config_attr['config'].startswith('CONFIG_'): config_attr['config'] = 'CONFIG_' + config_attr['config'] - move_config(config_attr, options.jobs) + move_config(config_attr, options) if __name__ == '__main__': main()