From patchwork Wed Jun 15 05:33:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 70086 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2398846qgf; Tue, 14 Jun 2016 22:51:51 -0700 (PDT) X-Received: by 10.28.64.213 with SMTP id n204mr8205613wma.7.1465969911541; Tue, 14 Jun 2016 22:51:51 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id y10si39446483wjd.68.2016.06.14.22.51.51; Tue, 14 Jun 2016 22:51:51 -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 0C00AA780C; Wed, 15 Jun 2016 07:49:44 +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 YsK_pEVLZLV7; Wed, 15 Jun 2016 07:49:43 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 351ABB381E; Wed, 15 Jun 2016 07:48:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 856F4A74F9 for ; Wed, 15 Jun 2016 07:34: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 ESNpJ0Jyj_ME for ; Wed, 15 Jun 2016 07:34:12 +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 07305A74FF 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 u5F5WZeF021857; Wed, 15 Jun 2016 14:32:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com u5F5WZeF021857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1465968759; bh=nH0LAwtVeceb2bLhaiSvRin5T7pVGhCErFb+I1G816A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CLwFI2RMr4SqYaRKmqo85velg63j/MPDx1sQO4tDeaX3IpdFHxe+cIqbhI+S7m5rm lKZR5k9j/lt0SwtXB5Pb7KQu0v1xoRYWsZGTO2CIG1YQEDbKhI4ieBHgGHw2LveEhs O9QWUsWU6XhUsvvnICeDbAJdZInuBOQTb1pfjyEh0wZFPCcJkF6gqt51lUNgHhLqBk UT8JyaUtgFb+GHH3r0nZR1TDGcejGndi59kesps5VpwMQCdPnRbZugBvczKdLyHNch mNbHsj2jHwV3d8qvdpvZHUD2mgC40TwpCGB/aXL4Kg2I5k1X7wduAFajlLdo7fl5Xq bxQMNBVuCtI2w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 15 Jun 2016 14:33:53 +0900 Message-Id: <1465968834-17361-5-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 4/5] tools: moveconfig: simplify show_failed_boards() and show more info 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" Since commit 1d085568b3de ("tools: moveconfig: display log atomically in more readable format"), the function color_text() is clever enough to exclude LF from escape sequences. Exploit it for removing the "for" loops from Slots.show_failed_boards(). Also, display "(the list has been saved in moveconfig.failed)" if there are failed boards. Signed-off-by: Masahiro Yamada --- tools/moveconfig.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 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 0e03751..f795a7f 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -860,21 +860,22 @@ class Slots: def show_failed_boards(self): """Display all of the failed boards (defconfigs).""" - failed_boards = [] + boards = [] + output_file = 'moveconfig.failed' for slot in self.slots: - failed_boards += slot.get_failed_boards() - - if len(failed_boards) > 0: - msg = [ "The following boards were not processed due to error:" ] - msg += failed_boards - for line in msg: - print >> sys.stderr, color_text(self.options.color, - COLOR_LIGHT_RED, line) - - with open('moveconfig.failed', 'w') as f: - for board in failed_boards: - f.write(board + '\n') + boards += slot.get_failed_boards() + + if boards: + boards = '\n'.join(boards) + '\n' + msg = "The following boards were not processed due to error:\n" + msg += boards + msg += "(the list has been saved in %s)\n" % output_file + print >> sys.stderr, color_text(self.options.color, COLOR_LIGHT_RED, + msg) + + with open(output_file, 'w') as f: + f.write(boards) class ReferenceSource: