diff options
-rwxr-xr-x | bitbake/bin/bitbake-layers | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/utils.py | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index edb4d2f03a..98794981a0 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers | |||
@@ -130,7 +130,7 @@ usage: add-layer <layerdir> | |||
130 | (notadded, _) = bb.utils.edit_bblayers_conf(bblayers_conf, layerdir, None) | 130 | (notadded, _) = bb.utils.edit_bblayers_conf(bblayers_conf, layerdir, None) |
131 | if notadded: | 131 | if notadded: |
132 | for item in notadded: | 132 | for item in notadded: |
133 | sys.stderr.write("Specified layer %s not in BBLAYERS\n" % item) | 133 | sys.stderr.write("Specified layer %s is already in BBLAYERS\n" % item) |
134 | 134 | ||
135 | 135 | ||
136 | def do_remove_layer(self, dirname): | 136 | def do_remove_layer(self, dirname): |
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 | ||