summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bblayers
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bblayers')
-rw-r--r--bitbake/lib/bblayers/action.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index b1326e5f53..a421380657 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -18,16 +18,18 @@ def plugin_init(plugins):
18 18
19class ActionPlugin(LayerPlugin): 19class ActionPlugin(LayerPlugin):
20 def do_add_layer(self, args): 20 def do_add_layer(self, args):
21 """Add a layer to bblayers.conf.""" 21 """Add one or more layers to bblayers.conf."""
22 layerdir = os.path.abspath(args.layerdir) 22 layerdirs = [os.path.abspath(ldir) for ldir in args.layerdir]
23 if not os.path.exists(layerdir):
24 sys.stderr.write("Specified layer directory doesn't exist\n")
25 return 1
26 23
27 layer_conf = os.path.join(layerdir, 'conf', 'layer.conf') 24 for layerdir in layerdirs:
28 if not os.path.exists(layer_conf): 25 if not os.path.exists(layerdir):
29 sys.stderr.write("Specified layer directory doesn't contain a conf/layer.conf file\n") 26 sys.stderr.write("Specified layer directory %s doesn't exist\n" % layerdir)
30 return 1 27 return 1
28
29 layer_conf = os.path.join(layerdir, 'conf', 'layer.conf')
30 if not os.path.exists(layer_conf):
31 sys.stderr.write("Specified layer directory %s doesn't contain a conf/layer.conf file\n" % layerdir)
32 return 1
31 33
32 bblayers_conf = os.path.join('conf', 'bblayers.conf') 34 bblayers_conf = os.path.join('conf', 'bblayers.conf')
33 if not os.path.exists(bblayers_conf): 35 if not os.path.exists(bblayers_conf):
@@ -40,7 +42,7 @@ class ActionPlugin(LayerPlugin):
40 shutil.copy2(bblayers_conf, backup) 42 shutil.copy2(bblayers_conf, backup)
41 43
42 try: 44 try:
43 notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdir, None) 45 notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None)
44 if not (args.force or notadded): 46 if not (args.force or notadded):
45 try: 47 try:
46 self.tinfoil.parseRecipes() 48 self.tinfoil.parseRecipes()
@@ -240,7 +242,7 @@ build results (as the layer priority order has effectively changed).
240 242
241 def register_commands(self, sp): 243 def register_commands(self, sp):
242 parser_add_layer = self.add_command(sp, 'add-layer', self.do_add_layer, parserecipes=False) 244 parser_add_layer = self.add_command(sp, 'add-layer', self.do_add_layer, parserecipes=False)
243 parser_add_layer.add_argument('layerdir', help='Layer directory to add') 245 parser_add_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to add')
244 246
245 parser_remove_layer = self.add_command(sp, 'remove-layer', self.do_remove_layer, parserecipes=False) 247 parser_remove_layer = self.add_command(sp, 'remove-layer', self.do_remove_layer, parserecipes=False)
246 parser_remove_layer.add_argument('layerdir', help='Layer directory to remove (wildcards allowed, enclose in quotes to avoid shell expansion)') 248 parser_remove_layer.add_argument('layerdir', help='Layer directory to remove (wildcards allowed, enclose in quotes to avoid shell expansion)')