All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] bitbake-layers show-recipes minor enhancement
@ 2019-09-13  3:58 Yeoh Ee Peng
  2019-09-13  3:58 ` [PATCH 1/3] bitbake: bitbake-layers: show-recipes: Show unique packagenames Yeoh Ee Peng
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yeoh Ee Peng @ 2019-09-13  3:58 UTC (permalink / raw)
  To: bitbake-devel

Minor enhancement to facilitate user to
 - view unique packagenames
 - view recipe or packagenames from user provided layer
 - view recipe or packagenames that removed the "(skipped)" tag

Yeoh Ee Peng (3):
  bitbake: bitbake-layers: show-recipes: Show unique packagenames
  bitbake: bitbake-layers: show-recipes: Select recipes from provided
    layer
  bitbake: bitbake-layers: show-recipes: Enable remove the (skipped) tag

 lib/bblayers/query.py | 39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)

-- 
2.7.4



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

* [PATCH 1/3] bitbake: bitbake-layers: show-recipes: Show unique packagenames
  2019-09-13  3:58 [PATCH 0/3] bitbake-layers show-recipes minor enhancement Yeoh Ee Peng
@ 2019-09-13  3:58 ` Yeoh Ee Peng
  2019-09-17 22:25   ` Paul Eggleton
  2019-09-13  3:58 ` [PATCH 2/3] bitbake: bitbake-layers: show-recipes: Select recipes from provided layer Yeoh Ee Peng
  2019-09-13  3:58 ` [PATCH 3/3] bitbake: bitbake-layers: show-recipes: Enable remove the (skipped) tag Yeoh Ee Peng
  2 siblings, 1 reply; 6+ messages in thread
From: Yeoh Ee Peng @ 2019-09-13  3:58 UTC (permalink / raw)
  To: bitbake-devel

Currently, show-recipes will show all recipes available (both
recipes with different version and recipes provided by more
than one layer).

Example of default $ bitbake-layers show-recipes:
core-image-rt:
  meta-intel           unknown (skipped)
  meta                 unknown (skipped)

yajl:
  meta-oe              2.1.0
  meta-oe              1.0.12

Add -p argument to enable showing unique packagenames. This
provide a focus view on unique recipes available.

Example of $ bitbake-layers show-recipes -p:
core-image-rt (skipped)
yajl

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 lib/bblayers/query.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/bblayers/query.py b/lib/bblayers/query.py
index 993589d..e13c00e 100644
--- a/lib/bblayers/query.py
+++ b/lib/bblayers/query.py
@@ -46,7 +46,7 @@ layer, with the preferred version first. Note that skipped recipes that
 are overlayed will also be listed, with a " (skipped)" suffix.
 """
 
-        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, True, None)
+        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None)
 
         # Check for overlayed .bbclass files
         classes = collections.defaultdict(list)
@@ -112,9 +112,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
             title = 'Matching recipes:'
         else:
             title = 'Available recipes:'
-        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.multiple, inheritlist)
+        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.packagenames, args.multiple, inheritlist)
 
-    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_multi_provider_only, inherits):
+    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_packagenames, show_multi_provider_only, inherits):
         if inherits:
             bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
             for classname in inherits:
@@ -153,6 +153,10 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
                     logger.plain("%s%s", f, skipped)
                 else:
                     logger.plain("  %s%s", f, skipped)
+            elif show_packagenames:
+                if pn not in show_unique_pn:
+                    show_unique_pn.append(pn)
+                    logger.plain("%s%s", pn, skipped)
             else:
                 if ispref:
                     logger.plain("%s:", pn)
@@ -162,6 +166,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
         cls_re = re.compile('classes/')
 
         preffiles = []
+        show_unique_pn = []
         items_listed = False
         for p in sorted(pkg_pn):
             if pnspec:
@@ -493,6 +498,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('-p', '--packagenames', help='instead of the default formatting, list packagenames of higher priority recipes only', 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(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)')
-- 
2.7.4



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

* [PATCH 2/3] bitbake: bitbake-layers: show-recipes: Select recipes from provided layer
  2019-09-13  3:58 [PATCH 0/3] bitbake-layers show-recipes minor enhancement Yeoh Ee Peng
  2019-09-13  3:58 ` [PATCH 1/3] bitbake: bitbake-layers: show-recipes: Show unique packagenames Yeoh Ee Peng
@ 2019-09-13  3:58 ` Yeoh Ee Peng
  2019-09-13  3:58 ` [PATCH 3/3] bitbake: bitbake-layers: show-recipes: Enable remove the (skipped) tag Yeoh Ee Peng
  2 siblings, 0 replies; 6+ messages in thread
From: Yeoh Ee Peng @ 2019-09-13  3:58 UTC (permalink / raw)
  To: bitbake-devel

Currently, show-recipes will show recipes from all configured layers.

Example of default $ bitbake-layers show-recipes:
core-image-rt:
  meta-intel           unknown (skipped)
  meta                 unknown (skipped)

Add -l argument to enable showing recipes from user provided layer.

Example: $ bitbake-layers show-recipes -l meta-intel
core-image-rt:
  meta-intel           unknown (skipped)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 lib/bblayers/query.py | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/lib/bblayers/query.py b/lib/bblayers/query.py
index e13c00e..8ba94ac 100644
--- a/lib/bblayers/query.py
+++ b/lib/bblayers/query.py
@@ -46,7 +46,7 @@ layer, with the preferred version first. Note that skipped recipes that
 are overlayed will also be listed, with a " (skipped)" suffix.
 """
 
-        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None)
+        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, None)
 
         # Check for overlayed .bbclass files
         classes = collections.defaultdict(list)
@@ -112,9 +112,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
             title = 'Matching recipes:'
         else:
             title = 'Available recipes:'
-        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.packagenames, args.multiple, inheritlist)
+        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.packagenames, args.multiple, args.layer, inheritlist)
 
-    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_packagenames, show_multi_provider_only, inherits):
+    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_packagenames, show_multi_provider_only, show_provided_layer_only, inherits):
         if inherits:
             bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
             for classname in inherits:
@@ -144,23 +144,24 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
                 preferred_versions[p] = (ver, fn)
 
         def print_item(f, pn, ver, layer, ispref):
-            if f in skiplist:
-                skipped = ' (skipped)'
-            else:
-                skipped = ''
-            if show_filenames:
-                if ispref:
-                    logger.plain("%s%s", f, skipped)
+            if not show_provided_layer_only or layer == show_provided_layer_only:
+                if f in skiplist:
+                    skipped = ' (skipped)'
                 else:
-                    logger.plain("  %s%s", f, skipped)
-            elif show_packagenames:
-                if pn not in show_unique_pn:
-                    show_unique_pn.append(pn)
-                    logger.plain("%s%s", pn, skipped)
-            else:
-                if ispref:
-                    logger.plain("%s:", pn)
-                logger.plain("  %s %s%s", layer.ljust(20), ver, skipped)
+                    skipped = ''
+                if show_filenames:
+                    if ispref:
+                        logger.plain("%s%s", f, skipped)
+                    else:
+                        logger.plain("  %s%s", f, skipped)
+                elif show_packagenames:
+                    if pn not in show_unique_pn:
+                        show_unique_pn.append(pn)
+                        logger.plain("%s%s", pn, skipped)
+                else:
+                    if ispref:
+                        logger.plain("%s:", pn)
+                    logger.plain("  %s %s%s", layer.ljust(20), ver, skipped)
 
         global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split()
         cls_re = re.compile('classes/')
@@ -501,6 +502,7 @@ NOTE: .bbappend files can impact the dependencies.
         parser_show_recipes.add_argument('-p', '--packagenames', help='instead of the default formatting, list packagenames of higher priority recipes only', 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(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
+        parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the provided layer', 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.7.4



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

* [PATCH 3/3] bitbake: bitbake-layers: show-recipes: Enable remove the (skipped) tag
  2019-09-13  3:58 [PATCH 0/3] bitbake-layers show-recipes minor enhancement Yeoh Ee Peng
  2019-09-13  3:58 ` [PATCH 1/3] bitbake: bitbake-layers: show-recipes: Show unique packagenames Yeoh Ee Peng
  2019-09-13  3:58 ` [PATCH 2/3] bitbake: bitbake-layers: show-recipes: Select recipes from provided layer Yeoh Ee Peng
@ 2019-09-13  3:58 ` Yeoh Ee Peng
  2019-09-17 22:29   ` Paul Eggleton
  2 siblings, 1 reply; 6+ messages in thread
From: Yeoh Ee Peng @ 2019-09-13  3:58 UTC (permalink / raw)
  To: bitbake-devel

Currently, show-recipes will append "(skipped)" to recipes which
were skipped due these recipes does not satisfied the configurations.

Example: $ bitbake-layers show-recipes -p
ace
backport-iwlwifi
core-image-rt (skipped)
core-image-rt-sdk (skipped)
core-image-tiny

Enable removal of the "(skipped)" tag appended to recipe using -r.

Example: $ bitbake-layers show-recipes -p -r
ace
backport-iwlwifi
core-image-rt
core-image-rt-sdk
core-image-tiny

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 lib/bblayers/query.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/bblayers/query.py b/lib/bblayers/query.py
index 8ba94ac..44ab907 100644
--- a/lib/bblayers/query.py
+++ b/lib/bblayers/query.py
@@ -46,7 +46,7 @@ layer, with the preferred version first. Note that skipped recipes that
 are overlayed will also be listed, with a " (skipped)" suffix.
 """
 
-        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, None)
+        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None)
 
         # Check for overlayed .bbclass files
         classes = collections.defaultdict(list)
@@ -112,9 +112,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
             title = 'Matching recipes:'
         else:
             title = 'Available recipes:'
-        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.packagenames, args.multiple, args.layer, inheritlist)
+        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.packagenames, args.multiple, args.layer, args.remove_skip_tag, inheritlist)
 
-    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_packagenames, show_multi_provider_only, show_provided_layer_only, inherits):
+    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_packagenames, show_multi_provider_only, show_provided_layer_only, remove_skip_tag, inherits):
         if inherits:
             bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
             for classname in inherits:
@@ -145,7 +145,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
 
         def print_item(f, pn, ver, layer, ispref):
             if not show_provided_layer_only or layer == show_provided_layer_only:
-                if f in skiplist:
+                if not remove_skip_tag and f in skiplist:
                     skipped = ' (skipped)'
                 else:
                     skipped = ''
@@ -503,6 +503,7 @@ NOTE: .bbappend files can impact the dependencies.
         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(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
         parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the provided layer', default='')
+        parser_show_recipes.add_argument('-r', '--remove-skip-tag', help='remove the "(skipped)" tag from recipes', action='store_true')
         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.7.4



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

* Re: [PATCH 1/3] bitbake: bitbake-layers: show-recipes: Show unique packagenames
  2019-09-13  3:58 ` [PATCH 1/3] bitbake: bitbake-layers: show-recipes: Show unique packagenames Yeoh Ee Peng
@ 2019-09-17 22:25   ` Paul Eggleton
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Eggleton @ 2019-09-17 22:25 UTC (permalink / raw)
  To: Yeoh Ee Peng; +Cc: bitbake-devel

On Friday, 13 September 2019 3:58:39 PM NZST Yeoh Ee Peng wrote:
> Currently, show-recipes will show all recipes available (both
> recipes with different version and recipes provided by more
> than one layer).
> 
> Example of default $ bitbake-layers show-recipes:
> core-image-rt:
>   meta-intel           unknown (skipped)
>   meta                 unknown (skipped)
> 
> yajl:
>   meta-oe              2.1.0
>   meta-oe              1.0.12
> 
> Add -p argument to enable showing unique packagenames. This
> provide a focus view on unique recipes available.

In this context, these aren't package names, they are recipe names - so we need to be using that naming. Accordingly I would recommend -r/--recipe-only as the option name.
 
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




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

* Re: [PATCH 3/3] bitbake: bitbake-layers: show-recipes: Enable remove the (skipped) tag
  2019-09-13  3:58 ` [PATCH 3/3] bitbake: bitbake-layers: show-recipes: Enable remove the (skipped) tag Yeoh Ee Peng
@ 2019-09-17 22:29   ` Paul Eggleton
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Eggleton @ 2019-09-17 22:29 UTC (permalink / raw)
  To: Yeoh Ee Peng; +Cc: bitbake-devel

On Friday, 13 September 2019 3:58:41 PM NZST Yeoh Ee Peng wrote:
> Currently, show-recipes will append "(skipped)" to recipes which
> were skipped due these recipes does not satisfied the configurations.
> 
> Example: $ bitbake-layers show-recipes -p
> ace
> backport-iwlwifi
> core-image-rt (skipped)
> core-image-rt-sdk (skipped)
> core-image-tiny
> 
> Enable removal of the "(skipped)" tag appended to recipe using -r.
> 
> Example: $ bitbake-layers show-recipes -p -r
> ace
> backport-iwlwifi
> core-image-rt
> core-image-rt-sdk
> core-image-tiny
> 
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> ---
>  lib/bblayers/query.py | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/bblayers/query.py b/lib/bblayers/query.py
> index 8ba94ac..44ab907 100644
> --- a/lib/bblayers/query.py
> +++ b/lib/bblayers/query.py
> @@ -46,7 +46,7 @@ layer, with the preferred version first. Note that skipped recipes that
>  are overlayed will also be listed, with a " (skipped)" suffix.
>  """
>  
> -        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, None)
> +        items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None)
>  
>          # Check for overlayed .bbclass files
>          classes = collections.defaultdict(list)
> @@ -112,9 +112,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
>              title = 'Matching recipes:'
>          else:
>              title = 'Available recipes:'
> -        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.packagenames, args.multiple, args.layer, inheritlist)
> +        self.list_recipes(title, args.pnspec, False, False, args.filenames, args.packagenames, args.multiple, args.layer, args.remove_skip_tag, inheritlist)
>  
> -    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_packagenames, show_multi_provider_only, show_provided_layer_only, inherits):
> +    def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_packagenames, show_multi_provider_only, show_provided_layer_only, remove_skip_tag, inherits):
>          if inherits:
>              bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
>              for classname in inherits:
> @@ -145,7 +145,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
>  
>          def print_item(f, pn, ver, layer, ispref):
>              if not show_provided_layer_only or layer == show_provided_layer_only:
> -                if f in skiplist:
> +                if not remove_skip_tag and f in skiplist:
>                      skipped = ' (skipped)'
>                  else:
>                      skipped = ''
> @@ -503,6 +503,7 @@ NOTE: .bbappend files can impact the dependencies.
>          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(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
>          parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the provided layer', default='')
> +        parser_show_recipes.add_argument('-r', '--remove-skip-tag', help='remove the "(skipped)" tag from recipes', action='store_true')

Rather than describing it in this way could we call this -b/--bare i.e. output just names without any additional markers e.g. "(skipped)"? This would allow us to have this disable any other such extraneous output in future.

Cheers
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




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

end of thread, other threads:[~2019-09-17 22:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13  3:58 [PATCH 0/3] bitbake-layers show-recipes minor enhancement Yeoh Ee Peng
2019-09-13  3:58 ` [PATCH 1/3] bitbake: bitbake-layers: show-recipes: Show unique packagenames Yeoh Ee Peng
2019-09-17 22:25   ` Paul Eggleton
2019-09-13  3:58 ` [PATCH 2/3] bitbake: bitbake-layers: show-recipes: Select recipes from provided layer Yeoh Ee Peng
2019-09-13  3:58 ` [PATCH 3/3] bitbake: bitbake-layers: show-recipes: Enable remove the (skipped) tag Yeoh Ee Peng
2019-09-17 22:29   ` 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.