diff options
-rw-r--r-- | bitbake/lib/bblayers/action.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py index a421380657..aa575d1c09 100644 --- a/bitbake/lib/bblayers/action.py +++ b/bitbake/lib/bblayers/action.py | |||
@@ -58,19 +58,22 @@ class ActionPlugin(LayerPlugin): | |||
58 | shutil.rmtree(tempdir) | 58 | shutil.rmtree(tempdir) |
59 | 59 | ||
60 | def do_remove_layer(self, args): | 60 | def do_remove_layer(self, args): |
61 | """Remove a layer from bblayers.conf.""" | 61 | """Remove one or more layers from bblayers.conf.""" |
62 | bblayers_conf = os.path.join('conf', 'bblayers.conf') | 62 | bblayers_conf = os.path.join('conf', 'bblayers.conf') |
63 | if not os.path.exists(bblayers_conf): | 63 | if not os.path.exists(bblayers_conf): |
64 | sys.stderr.write("Unable to find bblayers.conf\n") | 64 | sys.stderr.write("Unable to find bblayers.conf\n") |
65 | return 1 | 65 | return 1 |
66 | 66 | ||
67 | if args.layerdir.startswith('*'): | 67 | layerdirs = [] |
68 | layerdir = args.layerdir | 68 | for item in args.layerdir: |
69 | elif not '/' in args.layerdir: | 69 | if item.startswith('*'): |
70 | layerdir = '*/%s' % args.layerdir | 70 | layerdir = item |
71 | else: | 71 | elif not '/' in item: |
72 | layerdir = os.path.abspath(args.layerdir) | 72 | layerdir = '*/%s' % item |
73 | (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdir) | 73 | else: |
74 | layerdir = os.path.abspath(item) | ||
75 | layerdirs.append(layerdir) | ||
76 | (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs) | ||
74 | if notremoved: | 77 | if notremoved: |
75 | for item in notremoved: | 78 | for item in notremoved: |
76 | sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item) | 79 | sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item) |
@@ -245,7 +248,7 @@ build results (as the layer priority order has effectively changed). | |||
245 | parser_add_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to add') | 248 | parser_add_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to add') |
246 | 249 | ||
247 | parser_remove_layer = self.add_command(sp, 'remove-layer', self.do_remove_layer, parserecipes=False) | 250 | parser_remove_layer = self.add_command(sp, 'remove-layer', self.do_remove_layer, parserecipes=False) |
248 | parser_remove_layer.add_argument('layerdir', help='Layer directory to remove (wildcards allowed, enclose in quotes to avoid shell expansion)') | 251 | parser_remove_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to remove (wildcards allowed, enclose in quotes to avoid shell expansion)') |
249 | parser_remove_layer.set_defaults(func=self.do_remove_layer) | 252 | parser_remove_layer.set_defaults(func=self.do_remove_layer) |
250 | 253 | ||
251 | parser_flatten = self.add_command(sp, 'flatten', self.do_flatten) | 254 | parser_flatten = self.add_command(sp, 'flatten', self.do_flatten) |