diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2014-12-29 11:14:26 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-30 09:21:30 +0000 |
commit | 1c743fd2103730e27699dd55efc6914d3b0c3702 (patch) | |
tree | 16d0119e4e5cbb7998bb261bf4a247e39f0b2539 /lib | |
parent | 10a47b1ec7470c9e8c4ffe0bb35cdf6d1bb2ee2e (diff) | |
download | bitbake-1c743fd2103730e27699dd55efc6914d3b0c3702.tar.gz |
bitbake-layers: fix error handling in add-layer / remove-layer
* Fix add-layer error message when a layer is already in BBLAYERS
* Ensure we show an error message if we can't find BBLAYERS at all
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index f26349f4a..ef8cd4d62 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -1012,7 +1012,11 @@ def edit_bblayers_conf(bblayers_conf, add, remove): addlayers = layerlist_param(add) removelayers = layerlist_param(remove) + # Need to use a list here because we can't set non-local variables from a callback in python 2.x + bblayercalls = [] + def handle_bblayers(varname, origvalue): + bblayercalls.append(varname) updated = False bblayers = [remove_trailing_sep(x) for x in origvalue.split()] if removelayers: @@ -1040,5 +1044,9 @@ def edit_bblayers_conf(bblayers_conf, add, remove): return (origvalue, 2, False) edit_metadata_file(bblayers_conf, ['BBLAYERS'], handle_bblayers) + + if not bblayercalls: + raise Exception('Unable to find BBLAYERS in %s' % bblayers_conf) + return (notadded, notremoved) |