Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91B11EB64DC for ; Tue, 18 Jul 2023 20:35:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BC1FD86725; Tue, 18 Jul 2023 22:34:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.b="ULOV/F06"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DFDDF865FA; Tue, 18 Jul 2023 22:34:43 +0200 (CEST) Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 57EE9865FA for ; Tue, 18 Jul 2023 22:34:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=lHaZZIFOYqJOPFqj01qLdqT4sLx88Uz5EcSK3bFCBB4=; b=ULOV/F06uaP4P47BTAsdm1lAlvFiHw4dpUDfnkZSVa+EU90qDIuo6qU2FNOEuLHcWzSb Outbw4Ov5aWlt1LG5rMiwGa+r73OMa+jnptSYDwxGMorPNsuZKcxTCFh2s37sydsUDcjLR Y4aPRBQZIkIf7j6O4sXNQ+C10QRx28ca3FZVhNCGEdOZbINlrThlXsd3oyKRBawUyoo0/+ HjIIvSXAGQBDTYhNtCexKS61LdHWk78Zih1c/JFaRGwj9YYnQrwoNlZhBVwdWCmfDwYoZ2 jmq43fZ2MH72K6+R6fp+nAqSWEMIkYc5OicJGY3If6vp8hjgoAEzrqzFfj3ZyPDg== Received: by filterdrecv-77869f68cc-gch4b with SMTP id filterdrecv-77869f68cc-gch4b-1-64B6F75E-27 2023-07-18 20:34:38.965829423 +0000 UTC m=+5950718.126312741 Received: from bionic.localdomain (unknown) by geopod-ismtpd-9 (SG) with ESMTP id AfdjtoV8RLWi9jGtBC4n7Q Tue, 18 Jul 2023 20:34:38.743 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 6/7] binman: Show filename in missing blob help message Date: Tue, 18 Jul 2023 20:34:39 +0000 (UTC) Message-ID: <20230718203423.264341-7-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230718203423.264341-1-jonas@kwiboo.se> References: <20230718203423.264341-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h6SdxUO+9vitL2KTC?= =?us-ascii?Q?=2F0Upx+cg7NgcOZWq4tmC1CZe+netraz4IihrWON?= =?us-ascii?Q?M5LFgMTJNw1d3pziI1bV7lvFh9iz9pxHBZy+Ya8?= =?us-ascii?Q?j9M7URIdUWScxnvTC50bASq8bevld1mPRAw33q3?= =?us-ascii?Q?R5RbvjYcqEhtDf8wiIixsosb8oaHi+Zz5AQHk4?= To: Simon Glass , Alper Nebi Yasak Cc: u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Show the filename next to the node path in missing blob help messages, also show a generic missing blob message when there was no help message for the help tag. Signed-off-by: Jonas Karlman Reviewed-by: Simon Glass --- v2: - Add test - Collect r-b tag tools/binman/control.py | 13 ++++++++++--- tools/binman/ftest.py | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/binman/control.py b/tools/binman/control.py index fe5d704c4048..048d74a0b786 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -112,8 +112,8 @@ def _ReadMissingBlobHelp(): _FinishTag(tag, msg, result) return result -def _ShowBlobHelp(level, path, text): - tout.do_output(level, '%s:' % path) +def _ShowBlobHelp(level, path, text, fname): + tout.do_output(level, '%s (%s):' % (path, fname)) for line in text.splitlines(): tout.do_output(level, ' %s' % line) tout.do_output(level, '') @@ -133,10 +133,17 @@ def _ShowHelpForMissingBlobs(level, missing_list): tags = entry.GetHelpTags() # Show the first match help message + shown_help = False for tag in tags: if tag in missing_blob_help: - _ShowBlobHelp(level, entry._node.path, missing_blob_help[tag]) + _ShowBlobHelp(level, entry._node.path, missing_blob_help[tag], + entry.GetDefaultFilename()) + shown_help = True break + # Or a generic help message + if not shown_help: + _ShowBlobHelp(level, entry._node.path, "Missing blob", + entry.GetDefaultFilename()) def GetEntryModules(include_testing=True): """Get a set of entry class implementations diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 40ef6e5dce99..b2f78d3d0adb 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -3781,6 +3781,7 @@ class TestFunctional(unittest.TestCase): allow_missing=True) self.assertEqual(103, ret) err = stderr.getvalue() + self.assertIn('(missing-file)', err) self.assertRegex(err, "Image 'image'.*missing.*: blob-ext") self.assertIn('Some images are invalid', err) @@ -3791,6 +3792,7 @@ class TestFunctional(unittest.TestCase): allow_missing=True, ignore_missing=True) self.assertEqual(0, ret) err = stderr.getvalue() + self.assertIn('(missing-file)', err) self.assertRegex(err, "Image 'image'.*missing.*: blob-ext") self.assertIn('Some images are invalid', err) -- 2.41.0