summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-12-29 11:14:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-30 09:21:42 +0000
commitb264f5629b4c9399c6e8e298121c6dba424b95fe (patch)
treeda1515534963cd852de1abadb308dbcd761969a1 /bitbake/lib/bb/utils.py
parent6dde745bf90d9f9e52af3779df28879d91cbc64c (diff)
downloadpoky-b264f5629b4c9399c6e8e298121c6dba424b95fe.tar.gz
bitbake: 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 (Bitbake rev: 1c743fd2103730e27699dd55efc6914d3b0c3702) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index f26349f4a9..ef8cd4d624 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1012,7 +1012,11 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
1012 addlayers = layerlist_param(add) 1012 addlayers = layerlist_param(add)
1013 removelayers = layerlist_param(remove) 1013 removelayers = layerlist_param(remove)
1014 1014
1015 # Need to use a list here because we can't set non-local variables from a callback in python 2.x
1016 bblayercalls = []
1017
1015 def handle_bblayers(varname, origvalue): 1018 def handle_bblayers(varname, origvalue):
1019 bblayercalls.append(varname)
1016 updated = False 1020 updated = False
1017 bblayers = [remove_trailing_sep(x) for x in origvalue.split()] 1021 bblayers = [remove_trailing_sep(x) for x in origvalue.split()]
1018 if removelayers: 1022 if removelayers:
@@ -1040,5 +1044,9 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
1040 return (origvalue, 2, False) 1044 return (origvalue, 2, False)
1041 1045
1042 edit_metadata_file(bblayers_conf, ['BBLAYERS'], handle_bblayers) 1046 edit_metadata_file(bblayers_conf, ['BBLAYERS'], handle_bblayers)
1047
1048 if not bblayercalls:
1049 raise Exception('Unable to find BBLAYERS in %s' % bblayers_conf)
1050
1043 return (notadded, notremoved) 1051 return (notadded, notremoved)
1044 1052