diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-03 08:27:12 -1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-05 12:36:55 +0000 |
commit | d875c5e57b91c415292e530ce90f354107581be6 (patch) | |
tree | a4a692f3807db5066d3147c22f7f968a71640617 | |
parent | f18d2289d02a4c1ccefb2ddcedab073c82df411c (diff) | |
download | poky-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>
-rw-r--r-- | bitbake/lib/bblayers/action.py | 4 |
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) |