From patchwork Thu May 19 06:52:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 68089 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3032560qge; Wed, 18 May 2016 23:52:30 -0700 (PDT) X-Received: by 10.194.95.104 with SMTP id dj8mr11491673wjb.138.1463640750854; Wed, 18 May 2016 23:52:30 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id rz7si15753224wjb.177.2016.05.18.23.52.30; Wed, 18 May 2016 23:52:30 -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 9F4C9A760F; Thu, 19 May 2016 08:52:18 +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 rCXpfeIedqiY; Thu, 19 May 2016 08:52:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B960AA75CC; Thu, 19 May 2016 08:51:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 53ADFA74EE for ; Thu, 19 May 2016 08:51: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 oQD8CZKBJYK6 for ; Thu, 19 May 2016 08:51:31 +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-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by theia.denx.de (Postfix) with ESMTPS id 42ACEA750E for ; Thu, 19 May 2016 08:51:29 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id u4J6p2Zt001067; Thu, 19 May 2016 15:51:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u4J6p2Zt001067 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1463640675; bh=4CtH2U0W8ibIBdiUuPrxmvDUvwRRpcNwyHrqeMgI5UA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DuE6qMh1ZjEH6S4HZPVS8P5iHQxq7HaF8SZXSen4SZQnkpP1PS2N+P4X1ehv5I2Ge HO4+JsrRBuBemD50S2mBeetiEM6WvZ5wfa1vUfPnKdBU89c9fWScGmvSkLU1t/nZgm 3WRdYt9omibwlYOaLxfB+C2DUjvyzlEd5y8zxFQ9FaU7IU1e8VqQGfQLE8ISpWuy28 YD1vvTQcjZg59cj9EIfWNYBxG9ctOoJ5jQA6vDoqJFlAuG//XX1TvzqfVFYwDNw0UF c5ebpBINEZzVtYlbYCj95kd10DwjkK7W5P0ZHJkTbprW05evmi5JV/gXKdBJvBDemx 5Nk6sMSz/+2Lw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 May 2016 15:52:04 +0900 Message-Id: <1463640729-25666-17-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463640729-25666-1-git-send-email-yamada.masahiro@socionext.com> References: <1463640729-25666-1-git-send-email-yamada.masahiro@socionext.com> Cc: Joe Hershberger Subject: [U-Boot] [PATCH 16/21] tools: moveconfig: skip savedefconfig if .config was not updated 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" If no CONFIG option is moved to the .config, no need to sync the defconfig file. This accelerates the processing by skipping unneeded "make savedefconfig". Signed-off-by: Masahiro Yamada --- tools/moveconfig.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 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 da7120d..cb26b14 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -521,10 +521,13 @@ class KconfigParser: defconfig: defconfig name. Returns: - Return log string + Return a tuple of (updated flag, log string). + The "updated flag" is True if the .config was updated, False + otherwise. The "log string" shows what happend to the .config. """ results = [] + updated = False with open(self.dotconfig) as f: dotconfig_lines = f.readlines() @@ -559,11 +562,12 @@ class KconfigParser: for (action, value) in results: if action == ACTION_MOVE: f.write(value + '\n') + updated = True os.remove(self.config_autoconf) os.remove(self.autoconf) - return log + return (updated, log) class Slot: @@ -646,8 +650,11 @@ class Slot: If the configuration is successfully finished, assign a new subprocess to build include/autoconf.mk. If include/autoconf.mk is generated, invoke the parser to - parse the .config and the include/autoconf.mk, and then set the - slot back to the idle state. + parse the .config and the include/autoconf.mk, moving + config options to the .config as needed. + If the .config was updated, run "make savedefconfig" to sync + it, update the original defconfig, and then set the slot back + to the idle state. Returns: Return True if the subprocess is terminated, False otherwise @@ -668,8 +675,12 @@ class Slot: return True if self.state == STATE_AUTOCONF: - self.log += self.parser.update_dotconfig() + (updated, log) = self.parser.update_dotconfig() + self.log += log + if not updated: + self.finish(True) + return True """Save off the defconfig in a consistent way""" cmd = list(self.make_cmd) cmd.append('savedefconfig')