]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
configfragments.py: Improve reporting of errors
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Fri, 21 Nov 2025 13:25:31 +0000 (05:25 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 24 Nov 2025 17:48:50 +0000 (17:48 +0000)
Use bb.fatal() to report errors. This makes for a nicer experience for
the user.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/bbconfigbuild/configfragments.py

index efa98fa2a1aaec1bb39deaa93870055c73a0c03f..f5cbfc56ae07e7a4ace0849f67bc08f618a88be6 100644 (file)
@@ -28,10 +28,10 @@ class ConfigFragmentsPlugin(LayerPlugin):
         summary = d.getVar('BB_CONF_FRAGMENT_SUMMARY')
         description = d.getVar('BB_CONF_FRAGMENT_DESCRIPTION')
         if not summary:
-            raise Exception('Please add a one-line summary as BB_CONF_FRAGMENT_SUMMARY = \"...\" variable at the beginning of {}'.format(path))
+            bb.fatal('Please add a one-line summary as BB_CONF_FRAGMENT_SUMMARY = "..." variable at the beginning of {}'.format(path))
 
         if not description:
-            raise Exception('Please add a description as BB_CONF_FRAGMENT_DESCRIPTION = \"...\" variable at the beginning of {}'.format(path))
+            bb.fatal('Please add a description as BB_CONF_FRAGMENT_DESCRIPTION = "..." variable at the beginning of {}'.format(path))
 
         return summary, description
 
@@ -143,7 +143,7 @@ class ConfigFragmentsPlugin(LayerPlugin):
         fragments = self.discover_fragments()
         for f in args.fragmentname:
             if not self.get_fragment(f, fragments) and not self.builtin_fragment_exists(f):
-                raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f))
+                bb.fatal("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f))
 
         self.create_conf(args.confpath)
         modified = bb.utils.edit_metadata_file(args.confpath, ["OE_FRAGMENTS"], enable_helper)