From patchwork Mon Jul 25 10:15:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 72709 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1064668qga; Mon, 25 Jul 2016 03:15:43 -0700 (PDT) X-Received: by 10.28.25.71 with SMTP id 68mr19284027wmz.91.1469441743906; Mon, 25 Jul 2016 03:15:43 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id bo4si3023158wjb.112.2016.07.25.03.15.43; Mon, 25 Jul 2016 03:15:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 172D9A77AD; Mon, 25 Jul 2016 12:15:22 +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 kEuRRjSFIiwS; Mon, 25 Jul 2016 12:15:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E732A7772; Mon, 25 Jul 2016 12:15:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46C2CA77A7 for ; Mon, 25 Jul 2016 12:14:24 +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 Q_4-r0npMaTm for ; Mon, 25 Jul 2016 12:14:24 +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 conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by theia.denx.de (Postfix) with ESMTPS id 72C82A7792 for ; Mon, 25 Jul 2016 12:14:17 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u6PADhxJ021296; Mon, 25 Jul 2016 19:13:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u6PADhxJ021296 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1469441628; bh=eyaBmOMFFF5NKcQYRV/5Gi4wzzwzsJ33KVKQQ8hg9Ms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gg+7rGgyrp0XDhF0bwsZTLO1epI7LB3LiR6RWeu33cNQjO+IuLmphu/U9M+3OYcjB P2nFv13DnMNTZ6PiprMP67ng4FiyGEDdXZ2TDQu/wOKsZmpabsQtbnRX7d4twhMKun RdmgbFfYImuS3J75pbddkaORNlWo+PWznrtdpOE+roHRO0AdRx6MKKWMpnSKLsMKNW lni0Pgswp0rwoa3JEBuUi0DZrgKapjyNmHScScEhJGsjTlqDyGxJZeMy52si8TsEh/ OGo2Dc0rLLyY9ou8agAsBia75OP4QVckQ3Fv5lEnprPDFrnRyxxVBWOkNKWZ8+gXwx HsLLQVR0L6edQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 25 Jul 2016 19:15:28 +0900 Message-Id: <1469441729-5817-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469441729-5817-1-git-send-email-yamada.masahiro@socionext.com> References: <1469441729-5817-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini , Joe Hershberger Subject: [U-Boot] [PATCH v2 7/8] tools: moveconfig: make getting all defconfigs into helper function 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" I want to reuse this routine in the next commit. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added tools/moveconfig.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 5b1fa92..3b7499b 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -266,6 +266,16 @@ def get_make_cmd(): sys.exit('GNU Make not found') return ret[0].rstrip() +def get_all_defconfigs(): + """Get all the defconfig files under the configs/ directory.""" + defconfigs = [] + for (dirpath, dirnames, filenames) in os.walk('configs'): + dirpath = dirpath[len('configs') + 1:] + for filename in fnmatch.filter(filenames, '*_defconfig'): + defconfigs.append(os.path.join(dirpath, filename)) + + return defconfigs + def color_text(color_enabled, color, string): """Return colored string.""" if color_enabled: @@ -1079,12 +1089,7 @@ def move_config(configs, options): sys.exit('%s - defconfig does not exist. Stopping.' % defconfigs[i]) 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'): - defconfigs.append(os.path.join(dirpath, filename)) + defconfigs = get_all_defconfigs() progress = Progress(len(defconfigs)) slots = Slots(configs, options, progress, reference_src_dir)