From 71e6160da0aa5d1368b2ce8d3c93ebc5c882c612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20J=C3=B6rns?= Date: Fri, 15 Nov 2024 13:19:12 +0100 Subject: [PATCH] fitimage.bbclass: fix error handling for missing recipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'image' name should be printed rather than the (unset) 'recipe'. Also use f-strings for better readability. Since a missing recipe configuration is fatal to a proper generation, abort the parsing with bb.fatal instead of continuing with a broken configuration. Signed-off-by: Enrico Jörns --- meta-oe/classes/fitimage.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-oe/classes/fitimage.bbclass b/meta-oe/classes/fitimage.bbclass index 03c01a1ed3..9be35ae5e3 100644 --- a/meta-oe/classes/fitimage.bbclass +++ b/meta-oe/classes/fitimage.bbclass @@ -106,7 +106,7 @@ python __anonymous() { recipe = d.getVar('FITIMAGE_IMAGE_%s' % image) if not recipe: - bb.error("No recipe set for image '%s'. Specify via 'FITIMAGE_IMAGE_%s = \"\"'" % (recipe, image)) + bb.fatal(f"No recipe set for image '{image}'. Specify via 'FITIMAGE_IMAGE_{image} = \"\"'") return d.appendVarFlag('do_unpack', 'vardeps', ' FITIMAGE_IMAGE_%s' % image)