Yocto 2.5
Move OpenBMC to Yocto 2.5(sumo)
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/import-layers/yocto-poky/bitbake/lib/bblayers/action.py b/import-layers/yocto-poky/bitbake/lib/bblayers/action.py
index b1326e5..aa575d1 100644
--- a/import-layers/yocto-poky/bitbake/lib/bblayers/action.py
+++ b/import-layers/yocto-poky/bitbake/lib/bblayers/action.py
@@ -18,16 +18,18 @@
class ActionPlugin(LayerPlugin):
def do_add_layer(self, args):
- """Add a layer to bblayers.conf."""
- layerdir = os.path.abspath(args.layerdir)
- if not os.path.exists(layerdir):
- sys.stderr.write("Specified layer directory doesn't exist\n")
- return 1
+ """Add one or more layers to bblayers.conf."""
+ layerdirs = [os.path.abspath(ldir) for ldir in args.layerdir]
- layer_conf = os.path.join(layerdir, 'conf', 'layer.conf')
- if not os.path.exists(layer_conf):
- sys.stderr.write("Specified layer directory doesn't contain a conf/layer.conf file\n")
- return 1
+ for layerdir in layerdirs:
+ if not os.path.exists(layerdir):
+ sys.stderr.write("Specified layer directory %s doesn't exist\n" % layerdir)
+ return 1
+
+ layer_conf = os.path.join(layerdir, 'conf', 'layer.conf')
+ if not os.path.exists(layer_conf):
+ sys.stderr.write("Specified layer directory %s doesn't contain a conf/layer.conf file\n" % layerdir)
+ return 1
bblayers_conf = os.path.join('conf', 'bblayers.conf')
if not os.path.exists(bblayers_conf):
@@ -40,7 +42,7 @@
shutil.copy2(bblayers_conf, backup)
try:
- notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdir, None)
+ notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None)
if not (args.force or notadded):
try:
self.tinfoil.parseRecipes()
@@ -56,19 +58,22 @@
shutil.rmtree(tempdir)
def do_remove_layer(self, args):
- """Remove a layer from bblayers.conf."""
+ """Remove one or more layers from bblayers.conf."""
bblayers_conf = os.path.join('conf', 'bblayers.conf')
if not os.path.exists(bblayers_conf):
sys.stderr.write("Unable to find bblayers.conf\n")
return 1
- if args.layerdir.startswith('*'):
- layerdir = args.layerdir
- elif not '/' in args.layerdir:
- layerdir = '*/%s' % args.layerdir
- else:
- layerdir = os.path.abspath(args.layerdir)
- (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdir)
+ layerdirs = []
+ for item in args.layerdir:
+ if item.startswith('*'):
+ layerdir = item
+ elif not '/' in item:
+ layerdir = '*/%s' % item
+ else:
+ layerdir = os.path.abspath(item)
+ layerdirs.append(layerdir)
+ (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs)
if notremoved:
for item in notremoved:
sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item)
@@ -240,10 +245,10 @@
def register_commands(self, sp):
parser_add_layer = self.add_command(sp, 'add-layer', self.do_add_layer, parserecipes=False)
- parser_add_layer.add_argument('layerdir', help='Layer directory to add')
+ parser_add_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to add')
parser_remove_layer = self.add_command(sp, 'remove-layer', self.do_remove_layer, parserecipes=False)
- parser_remove_layer.add_argument('layerdir', help='Layer directory to remove (wildcards allowed, enclose in quotes to avoid shell expansion)')
+ parser_remove_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to remove (wildcards allowed, enclose in quotes to avoid shell expansion)')
parser_remove_layer.set_defaults(func=self.do_remove_layer)
parser_flatten = self.add_command(sp, 'flatten', self.do_flatten)
diff --git a/import-layers/yocto-poky/bitbake/lib/bblayers/query.py b/import-layers/yocto-poky/bitbake/lib/bblayers/query.py
index bef3af3..9294dfa 100644
--- a/import-layers/yocto-poky/bitbake/lib/bblayers/query.py
+++ b/import-layers/yocto-poky/bitbake/lib/bblayers/query.py
@@ -161,7 +161,12 @@
items_listed = False
for p in sorted(pkg_pn):
if pnspec:
- if not fnmatch.fnmatch(p, pnspec):
+ found=False
+ for pnm in pnspec:
+ if fnmatch.fnmatch(p, pnm):
+ found=True
+ break
+ if not found:
continue
if len(allproviders[p]) > 1 or not show_multi_provider_only:
@@ -251,8 +256,14 @@
pnlist.sort()
appends = False
for pn in pnlist:
- if args.pnspec and pn != args.pnspec:
- continue
+ if args.pnspec:
+ found=False
+ for pnm in args.pnspec:
+ if fnmatch.fnmatch(pn, pnm):
+ found=True
+ break
+ if not found:
+ continue
if self.show_appends_for_pn(pn):
appends = True
@@ -479,11 +490,11 @@
parser_show_recipes = self.add_command(sp, 'show-recipes', self.do_show_recipes)
parser_show_recipes.add_argument('-f', '--filenames', help='instead of the default formatting, list filenames of higher priority recipes with the ones they overlay indented underneath', action='store_true')
parser_show_recipes.add_argument('-m', '--multiple', help='only list where multiple recipes (in the same layer or different layers) exist for the same recipe name', action='store_true')
- parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class', metavar='CLASS', default='')
- parser_show_recipes.add_argument('pnspec', nargs='?', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
+ parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
+ parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
parser_show_appends = self.add_command(sp, 'show-appends', self.do_show_appends)
- parser_show_appends.add_argument('pnspec', nargs='?', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
+ parser_show_appends.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
parser_show_cross_depends = self.add_command(sp, 'show-cross-depends', self.do_show_cross_depends)
parser_show_cross_depends.add_argument('-f', '--filenames', help='show full file path', action='store_true')