summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-03 08:27:12 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-05 12:36:55 +0000
commitd875c5e57b91c415292e530ce90f354107581be6 (patch)
treea4a692f3807db5066d3147c22f7f968a71640617 /bitbake
parentf18d2289d02a4c1ccefb2ddcedab073c82df411c (diff)
downloadpoky-d875c5e57b91c415292e530ce90f354107581be6.tar.gz
bitbake: bblayers/action: When adding layers, catch BBHandledException
When adding a layer, parse error can occur, raising BBHandledException. Catch this and error, aborting the layer add to meet user expectations. [YOCTO #14054] (Bitbake rev: f18b65d0b9a6b983d53bde491e1bf2ca56949444) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ceddb5b3d229b83c172656053cd29aeb521fcce0) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bblayers/action.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index d6459d6617..d2f9c1bbde 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -50,10 +50,10 @@ class ActionPlugin(LayerPlugin):
50 if not (args.force or notadded): 50 if not (args.force or notadded):
51 try: 51 try:
52 self.tinfoil.run_command('parseConfiguration') 52 self.tinfoil.run_command('parseConfiguration')
53 except bb.tinfoil.TinfoilUIException: 53 except (bb.tinfoil.TinfoilUIException, bb.BBHandledException):
54 # Restore the back up copy of bblayers.conf 54 # Restore the back up copy of bblayers.conf
55 shutil.copy2(backup, bblayers_conf) 55 shutil.copy2(backup, bblayers_conf)
56 bb.fatal("Parse failure with the specified layer added") 56 bb.fatal("Parse failure with the specified layer added, aborting.")
57 else: 57 else:
58 for item in notadded: 58 for item in notadded:
59 sys.stderr.write("Specified layer %s is already in BBLAYERS\n" % item) 59 sys.stderr.write("Specified layer %s is already in BBLAYERS\n" % item)