All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] bitbake-layers improvements
@ 2017-11-08  2:17 Paul Eggleton
  2017-11-08  2:17 ` [PATCH 1/3] bitbake-layers: add-layer: enable adding multiple layers at once Paul Eggleton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-11-08  2:17 UTC (permalink / raw)
  To: bitbake-devel

Some minor usability improvements for bitbake-layers.


The following changes since commit e1e8565b5e19dd3f7ef6e7e41932456adaa3df81:

  tests/fetch: Add ftp test url (2017-11-07 14:41:54 +0000)

are available in the git repository at:

  git://git.openembedded.org/bitbake-contrib paule/bblayers-fix2
  http://cgit.openembedded.org/bitbake-contrib/log/?h=paule/bblayers-fix2

Paul Eggleton (3):
  bitbake-layers: add-layer: enable adding multiple layers at once
  bitbake-layers: remove-layer: support removing multiple layers at a time
  bitbake-layers: show-recipes: fix help to mention -i supports multiple classes

 lib/bblayers/action.py | 45 +++++++++++++++++++++++++--------------------
 lib/bblayers/query.py  |  2 +-
 2 files changed, 26 insertions(+), 21 deletions(-)

-- 
2.9.5



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] bitbake-layers: add-layer: enable adding multiple layers at once
  2017-11-08  2:17 [PATCH 0/3] bitbake-layers improvements Paul Eggleton
@ 2017-11-08  2:17 ` Paul Eggleton
  2017-11-08  2:17 ` [PATCH 2/3] bitbake-layers: remove-layer: support removing multiple layers at a time Paul Eggleton
  2017-11-08  2:17 ` [PATCH 3/3] bitbake-layers: show-recipes: fix help to mention -i supports multiple classes Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-11-08  2:17 UTC (permalink / raw)
  To: bitbake-devel

Allow specifying multiple layers with bitbake-layers add-layer so that
you can add more than one in a single command. This is not just useful,
it's actually pretty important if you need to add a layer and its
dependencies at the same time - since we now go through a parse process
when the layer is added, without this you have to add them all in just
the right order and wait for the parse each time which is somewhat
painful.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bblayers/action.py | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/lib/bblayers/action.py b/lib/bblayers/action.py
index b1326e5..a421380 100644
--- a/lib/bblayers/action.py
+++ b/lib/bblayers/action.py
@@ -18,16 +18,18 @@ def plugin_init(plugins):
 
 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 @@ class ActionPlugin(LayerPlugin):
         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()
@@ -240,7 +242,7 @@ build results (as the layer priority order has effectively changed).
 
     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)')
-- 
2.9.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] bitbake-layers: remove-layer: support removing multiple layers at a time
  2017-11-08  2:17 [PATCH 0/3] bitbake-layers improvements Paul Eggleton
  2017-11-08  2:17 ` [PATCH 1/3] bitbake-layers: add-layer: enable adding multiple layers at once Paul Eggleton
@ 2017-11-08  2:17 ` Paul Eggleton
  2017-11-08  2:17 ` [PATCH 3/3] bitbake-layers: show-recipes: fix help to mention -i supports multiple classes Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-11-08  2:17 UTC (permalink / raw)
  To: bitbake-devel

If you can add multiple layers at once, it stands to reason that you
should also be able to remove more than one at a time.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bblayers/action.py | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lib/bblayers/action.py b/lib/bblayers/action.py
index a421380..aa575d1 100644
--- a/lib/bblayers/action.py
+++ b/lib/bblayers/action.py
@@ -58,19 +58,22 @@ class ActionPlugin(LayerPlugin):
             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)
@@ -245,7 +248,7 @@ build results (as the layer priority order has effectively changed).
         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)
-- 
2.9.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] bitbake-layers: show-recipes: fix help to mention -i supports multiple classes
  2017-11-08  2:17 [PATCH 0/3] bitbake-layers improvements Paul Eggleton
  2017-11-08  2:17 ` [PATCH 1/3] bitbake-layers: add-layer: enable adding multiple layers at once Paul Eggleton
  2017-11-08  2:17 ` [PATCH 2/3] bitbake-layers: remove-layer: support removing multiple layers at a time Paul Eggleton
@ 2017-11-08  2:17 ` Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-11-08  2:17 UTC (permalink / raw)
  To: bitbake-devel

The -i option supports more than one class, but the help didn't mention
that.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bblayers/query.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bblayers/query.py b/lib/bblayers/query.py
index efd22cb..9294dfa 100644
--- a/lib/bblayers/query.py
+++ b/lib/bblayers/query.py
@@ -490,7 +490,7 @@ NOTE: .bbappend files can impact the dependencies.
         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('-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)
-- 
2.9.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-08  2:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08  2:17 [PATCH 0/3] bitbake-layers improvements Paul Eggleton
2017-11-08  2:17 ` [PATCH 1/3] bitbake-layers: add-layer: enable adding multiple layers at once Paul Eggleton
2017-11-08  2:17 ` [PATCH 2/3] bitbake-layers: remove-layer: support removing multiple layers at a time Paul Eggleton
2017-11-08  2:17 ` [PATCH 3/3] bitbake-layers: show-recipes: fix help to mention -i supports multiple classes Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.