From patchwork Wed Jun 15 05:33:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 70087 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2398896qgf; Tue, 14 Jun 2016 22:52:03 -0700 (PDT) X-Received: by 10.194.186.179 with SMTP id fl19mr10408834wjc.2.1465969923650; Tue, 14 Jun 2016 22:52:03 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id iu2si39343742wjb.231.2016.06.14.22.52.03; Tue, 14 Jun 2016 22:52:03 -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 C9044A77E9; Wed, 15 Jun 2016 07:49:48 +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 aOYCWBzS9bVz; Wed, 15 Jun 2016 07:49:48 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2EBBCB3824; Wed, 15 Jun 2016 07:48:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9AEBEA74FF for ; Wed, 15 Jun 2016 07:34: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 Vi2eOrKj3Hs6 for ; Wed, 15 Jun 2016 07:34: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 conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by theia.denx.de (Postfix) with ESMTPS id 7219CA74DB for ; Wed, 15 Jun 2016 07:33:01 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id u5F5WZeG021857; Wed, 15 Jun 2016 14:32:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com u5F5WZeG021857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1465968760; bh=3g1W8M3sB180VeDhgqqW9EGtuleNOZGjZVRY/PE2frU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FdaCb53hJ81gYhGnNDBiDL6lqaB8FWAGiDY67kPWAGhIi/HLVt38X/+BCUm7zcl7R l5ezwTLVljko4K+6nd26R+NjrHoD8SQIztUdMpECsSvFs0LIFmXAiVqHTspkKH9OW3 dieJEsdnZX7WSwtpAiyzr8XD69fOE8CUYJjpI7jOK+tOQEuUL8hgw2yuVm/KXWGttZ l5qSTz1wXs0hXN3+jUMNTkeGLs0XSHWaeOhS5Z9EUB05BAv9KtBGykRCg3lqyZL3s8 UksnF3/Ag7Uy+8689m1Wd6hrCBgoWbUl0fsNZJhM/vfw57/WtfAAwQtmtfnl0dXT8G muua4xKNqMkhg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 15 Jun 2016 14:33:54 +0900 Message-Id: <1465968834-17361-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465968834-17361-1-git-send-email-yamada.masahiro@socionext.com> References: <1465968834-17361-1-git-send-email-yamada.masahiro@socionext.com> Cc: Joe Hershberger Subject: [U-Boot] [PATCH 5/5] tools: moveconfig: show suspicious boards with possible misconversion 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" There are some cases where config options are moved, but they are ripped off at the final savedefconfig stage: - The moved option is not user-configurable, for example, due to a missing prompt in the Kconfig entry - The config was not defined in the original config header despite the Kconfig specifies it as non-bool type - The config define in the header contains reference to another macro, for example: #define CONFIG_CONS_INDEX (CONFIG_SYS_LPC32XX_UART - 2) The current moveconfig does not support recursive macro expansion. In these cases, the conversion is very likely to be an unexpected result. That is why I decided to display the log in yellow color in commit 5da4f857beac ("tools: moveconfig: report when CONFIGs are removed by savedefconfig"). It would be nice to display the list of suspicious boards when the tool finishes processing. It is highly recommended to check the defconfigs once again when this message is displayed. Signed-off-by: Masahiro Yamada --- tools/moveconfig.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) -- 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 f795a7f..bf60dbc 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -611,6 +611,7 @@ class Slot: self.parser = KconfigParser(configs, options, self.build_dir) self.state = STATE_IDLE self.failed_boards = [] + self.suspicious_boards = [] def __del__(self): """Delete the working directory @@ -755,7 +756,10 @@ class Slot: def update_defconfig(self): """Update the input defconfig and go back to the idle state.""" - self.log += self.parser.check_defconfig() + log = self.parser.check_defconfig() + if log: + self.suspicious_boards.append(self.defconfig) + self.log += log orig_defconfig = os.path.join('configs', self.defconfig) new_defconfig = os.path.join(self.build_dir, 'defconfig') updated = not filecmp.cmp(orig_defconfig, new_defconfig) @@ -799,6 +803,11 @@ class Slot: """ return self.failed_boards + def get_suspicious_boards(self): + """Returns a list of boards (defconfigs) with possible misconversion. + """ + return self.suspicious_boards + class Slots: """Controller of the array of subprocess slots.""" @@ -877,6 +886,26 @@ class Slots: with open(output_file, 'w') as f: f.write(boards) + def show_suspicious_boards(self): + """Display all boards (defconfigs) with possible misconversion.""" + boards = [] + output_file = 'moveconfig.suspicious' + + for slot in self.slots: + boards += slot.get_suspicious_boards() + + if boards: + boards = '\n'.join(boards) + '\n' + msg = "The following boards might have been converted incorrectly.\n" + msg += "It is highly recommended to check them manually:\n" + msg += boards + msg += "(the list has been saved in %s)\n" % output_file + print >> sys.stderr, color_text(self.options.color, COLOR_YELLOW, + msg) + + with open(output_file, 'w') as f: + f.write(boards) + class ReferenceSource: """Reference source against which original configs should be parsed.""" @@ -967,6 +996,7 @@ def move_config(configs, options): print '' slots.show_failed_boards() + slots.show_suspicious_boards() def main(): try: