From patchwork Thu May 19 06:52:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 68100 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3033278qge; Wed, 18 May 2016 23:54:46 -0700 (PDT) X-Received: by 10.28.136.12 with SMTP id k12mr12224883wmd.58.1463640886846; Wed, 18 May 2016 23:54:46 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id wt5si15786720wjb.111.2016.05.18.23.54.46; Wed, 18 May 2016 23:54:46 -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 476D7A767B; Thu, 19 May 2016 08:53:41 +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 j8tSHO6CmtZy; Thu, 19 May 2016 08:53:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9146A767A; Thu, 19 May 2016 08:52:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1DA2A76C8 for ; Thu, 19 May 2016 08:52:40 +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 QxLvxRDBJU1z for ; Thu, 19 May 2016 08:52:40 +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 A510AA7658 for ; Thu, 19 May 2016 08:51:55 +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 u4J6p2Zv001067; Thu, 19 May 2016 15:51:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u4J6p2Zv001067 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1463640676; bh=bSkC1DHwx77OVgnWDs/BBuaOtOXCCNZeUKt1V/EaVXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g7zYGTgPiryy4JQhOA6LHTRj/Hc1jNamW7arZtvvK+r1MLM+hd2kwuwowss7wDpGQ +v0awVbtz+aNlSAteaT0h2Dp6LdRJuOiO9KfE6qkQIuWl/a7dhe2YLdNwHtrR+tEFJ 3RsH1fRXv6xR/ufjoyufhje8s6u6NlgABH+cy9YOQxiSSPJGZaMIPbWXNDZe3jOMfY YtCY3PRaB6DjXmpJxVExbOIkfXSmqrv2q+3AeGFpQ23IAIwuoCZaQNFLsy983BK5Ov owhH2pEWbg4Z91Q9QJYAJ0vr7yQ8cK+TkHTc1zW0E0WJz1m7+djDaL7spbTmnHERMb fTszshH9ov2pA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 May 2016 15:52:06 +0900 Message-Id: <1463640729-25666-19-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 18/21] tools: moveconfig: report when CONFIGs are removed by savedefconfig 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 a rare case, but there is still possibility that some CONFIG is moved to the .config, but it is removed by "make savedefconfig". (For example, it happens when the specified CONFIG has no prompt in the Kconfig entry, i.e. it is not user-configurable.) It might be an unexpected case. So, display the log in this case (in yellow color to gain user's attention if --color option is given). Signed-off-by: Masahiro Yamada --- tools/moveconfig.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) -- 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 80542c5..9c73b30 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -432,6 +432,7 @@ class KconfigParser: self.autoconf = os.path.join(build_dir, 'include', 'autoconf.mk') self.config_autoconf = os.path.join(build_dir, 'include', 'config', 'auto.conf') + self.defconfig = os.path.join(build_dir, 'defconfig') def get_cross_compile(self): """Parse .config file and return CROSS_COMPILE. @@ -564,11 +565,35 @@ class KconfigParser: f.write(value + '\n') updated = True + self.results = results os.remove(self.config_autoconf) os.remove(self.autoconf) return (updated, log) + def check_defconfig(self): + """Check the defconfig after savedefconfig + + Returns: + Return additional log if moved CONFIGs were removed again by + 'make savedefconfig'. + """ + + log = '' + + with open(self.defconfig) as f: + defconfig_lines = f.readlines() + + for (action, value) in self.results: + if action != ACTION_MOVE: + continue + if not value + '\n' in defconfig_lines: + log += color_text(self.options.color, COLOR_YELLOW, + "'%s' was removed by savedefconfig.\n" % + value) + + return log + class Slot: """A slot to store a subprocess. @@ -691,6 +716,7 @@ class Slot: return False if self.state == STATE_SAVEDEFCONFIG: + self.log += self.parser.check_defconfig() if not self.options.dry_run: shutil.move(os.path.join(self.build_dir, 'defconfig'), os.path.join('configs', self.defconfig))