All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: cooker: list all nonexistent bblayer directories
@ 2019-06-13 23:42 Oleksandr Kravchuk
  2019-06-13 23:43 ` Oleksandr Kravchuk
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Kravchuk @ 2019-06-13 23:42 UTC (permalink / raw
  To: openembedded-core; +Cc: Oleksandr Kravchuk

Check existence of all the bblayer direcotories at once and print them
all, so if there are multiple nonexistent directories, user does not
have to correct bblayers.conf and restart bitbake multiple times.

[YOCTO #11647]

Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
---
 bitbake/lib/bb/cookerdata.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index f8ae41093b..be1c332eb5 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -342,14 +342,24 @@ class CookerDataBuilder(object):
             data = parse_config_file(layerconf, data)
 
             layers = (data.getVar('BBLAYERS') or "").split()
+            broken_layers = []
 
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
+
+            # Check whether present layer directories exist
             for layer in layers:
                 if not os.path.isdir(layer):
-                    parselog.critical("Layer directory '%s' does not exist! "
-                                      "Please check BBLAYERS in %s" % (layer, layerconf))
-                    sys.exit(1)
+                    broken_layers.append(layer)
+
+            if broken_layers:
+                parselog.critical("The following layer directories do not exist:")
+                for layer in broken_layers:
+                    parselog.critical("- %s", layer)
+                parselog.critical("Please check BBLAYERS in %s" % (layerconf))
+                sys.exit(1)
+
+            for layer in layers:
                 parselog.debug(2, "Adding layer %s", layer)
                 if 'HOME' in approved and '~' in layer:
                     layer = os.path.expanduser(layer)
-- 
2.17.1



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

* Re: [PATCH] bitbake: cooker: list all nonexistent bblayer directories
  2019-06-13 23:42 Oleksandr Kravchuk
@ 2019-06-13 23:43 ` Oleksandr Kravchuk
  0 siblings, 0 replies; 5+ messages in thread
From: Oleksandr Kravchuk @ 2019-06-13 23:43 UTC (permalink / raw
  To: openembedded-core

This is how it'll look like:

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session
(/home/sashko/projects/yocto/open-embedded/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 7414 at 2019-06-14 01:35:10.070371 ---
ERROR: The following layer directories do not exist:
ERROR: - /home/sashko/projects/yocto/open-embedded/sources/poky/meta-abc
ERROR: - /home/sashko/projects/yocto/open-embedded/sources/poky/meta-xyz
ERROR: Please check BBLAYERS in
/home/sashko/projects/yocto/open-embedded/build/conf/bblayers.conf

Feel free to suggest better way to present this information to a user.

On 14/06/2019 01:42, Oleksandr Kravchuk wrote:
> Check existence of all the bblayer direcotories at once and print them
> all, so if there are multiple nonexistent directories, user does not
> have to correct bblayers.conf and restart bitbake multiple times.
>
> [YOCTO #11647]
>
> Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
> ---
>  bitbake/lib/bb/cookerdata.py | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
> index f8ae41093b..be1c332eb5 100644
> --- a/bitbake/lib/bb/cookerdata.py
> +++ b/bitbake/lib/bb/cookerdata.py
> @@ -342,14 +342,24 @@ class CookerDataBuilder(object):
>              data = parse_config_file(layerconf, data)
>  
>              layers = (data.getVar('BBLAYERS') or "").split()
> +            broken_layers = []
>  
>              data = bb.data.createCopy(data)
>              approved = bb.utils.approved_variables()
> +
> +            # Check whether present layer directories exist
>              for layer in layers:
>                  if not os.path.isdir(layer):
> -                    parselog.critical("Layer directory '%s' does not exist! "
> -                                      "Please check BBLAYERS in %s" % (layer, layerconf))
> -                    sys.exit(1)
> +                    broken_layers.append(layer)
> +
> +            if broken_layers:
> +                parselog.critical("The following layer directories do not exist:")
> +                for layer in broken_layers:
> +                    parselog.critical("- %s", layer)
> +                parselog.critical("Please check BBLAYERS in %s" % (layerconf))
> +                sys.exit(1)
> +
> +            for layer in layers:
>                  parselog.debug(2, "Adding layer %s", layer)
>                  if 'HOME' in approved and '~' in layer:
>                      layer = os.path.expanduser(layer)


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

* [PATCH] bitbake: cooker: list all nonexistent bblayer directories
@ 2019-06-14  0:09 Oleksandr Kravchuk
  2019-06-14  0:09 ` Oleksandr Kravchuk
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Kravchuk @ 2019-06-14  0:09 UTC (permalink / raw
  To: bitbake-devel; +Cc: Oleksandr Kravchuk

Check existence of all the bblayer direcotories at once and print them
all, so if there are multiple nonexistent directories, user does not
have to correct bblayers.conf and restart bitbake multiple times.

[YOCTO #11647]

Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
---
 bitbake/lib/bb/cookerdata.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index f8ae41093b..842275d530 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -342,14 +342,24 @@ class CookerDataBuilder(object):
             data = parse_config_file(layerconf, data)
 
             layers = (data.getVar('BBLAYERS') or "").split()
+            broken_layers = []
 
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
+
+            # Check whether present layer directories exist
             for layer in layers:
                 if not os.path.isdir(layer):
-                    parselog.critical("Layer directory '%s' does not exist! "
-                                      "Please check BBLAYERS in %s" % (layer, layerconf))
-                    sys.exit(1)
+                    broken_layers.append(layer)
+
+            if broken_layers:
+                parselog.critical("The following layer directories do not exist:")
+                for layer in broken_layers:
+                    parselog.critical("   %s", layer)
+                parselog.critical("Please check BBLAYERS in %s" % (layerconf))
+                sys.exit(1)
+
+            for layer in layers:
                 parselog.debug(2, "Adding layer %s", layer)
                 if 'HOME' in approved and '~' in layer:
                     layer = os.path.expanduser(layer)
-- 
2.17.1



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

* Re: [PATCH] bitbake: cooker: list all nonexistent bblayer directories
  2019-06-14  0:09 [PATCH] bitbake: cooker: list all nonexistent bblayer directories Oleksandr Kravchuk
@ 2019-06-14  0:09 ` Oleksandr Kravchuk
  2019-06-18 15:58   ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Kravchuk @ 2019-06-14  0:09 UTC (permalink / raw
  To: bitbake-devel

This is how log will look like:

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session
(/home/sashko/projects/yocto/open-embedded/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 11745 at 2019-06-14 02:08:15.687299 ---
ERROR: The following layer directories do not exist:
ERROR:    /home/sashko/projects/yocto/open-embedded/sources/poky/meta-abc
ERROR:    /home/sashko/projects/yocto/open-embedded/sources/poky/meta-xyz
ERROR: Please check BBLAYERS in
/home/sashko/projects/yocto/open-embedded/build/conf/bblayers.conf

On 14/06/2019 02:09, Oleksandr Kravchuk wrote:
> Check existence of all the bblayer direcotories at once and print them
> all, so if there are multiple nonexistent directories, user does not
> have to correct bblayers.conf and restart bitbake multiple times.
>
> [YOCTO #11647]
>
> Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
> ---
>  bitbake/lib/bb/cookerdata.py | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
> index f8ae41093b..842275d530 100644
> --- a/bitbake/lib/bb/cookerdata.py
> +++ b/bitbake/lib/bb/cookerdata.py
> @@ -342,14 +342,24 @@ class CookerDataBuilder(object):
>              data = parse_config_file(layerconf, data)
>  
>              layers = (data.getVar('BBLAYERS') or "").split()
> +            broken_layers = []
>  
>              data = bb.data.createCopy(data)
>              approved = bb.utils.approved_variables()
> +
> +            # Check whether present layer directories exist
>              for layer in layers:
>                  if not os.path.isdir(layer):
> -                    parselog.critical("Layer directory '%s' does not exist! "
> -                                      "Please check BBLAYERS in %s" % (layer, layerconf))
> -                    sys.exit(1)
> +                    broken_layers.append(layer)
> +
> +            if broken_layers:
> +                parselog.critical("The following layer directories do not exist:")
> +                for layer in broken_layers:
> +                    parselog.critical("   %s", layer)
> +                parselog.critical("Please check BBLAYERS in %s" % (layerconf))
> +                sys.exit(1)
> +
> +            for layer in layers:
>                  parselog.debug(2, "Adding layer %s", layer)
>                  if 'HOME' in approved and '~' in layer:
>                      layer = os.path.expanduser(layer)


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

* Re: [PATCH] bitbake: cooker: list all nonexistent bblayer directories
  2019-06-14  0:09 ` Oleksandr Kravchuk
@ 2019-06-18 15:58   ` Richard Purdie
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2019-06-18 15:58 UTC (permalink / raw
  To: Oleksandr Kravchuk, bitbake-devel

On Fri, 2019-06-14 at 02:09 +0200, Oleksandr Kravchuk wrote:
> This is how log will look like:
> 
> ERROR: Unable to start bitbake server (None)
> ERROR: Server log for this session
> (/home/sashko/projects/yocto/open-embedded/build/bitbake-
> cookerdaemon.log):
> --- Starting bitbake server pid 11745 at 2019-06-14 02:08:15.687299
> ---
> ERROR: The following layer directories do not exist:
> ERROR:    /home/sashko/projects/yocto/open-
> embedded/sources/poky/meta-abc
> ERROR:    /home/sashko/projects/yocto/open-
> embedded/sources/poky/meta-xyz
> ERROR: Please check BBLAYERS in
> /home/sashko/projects/yocto/open-embedded/build/conf/bblayers.conf

Looks good to me, I've merged this thanks!

Cheers,

Richard



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

end of thread, other threads:[~2019-06-18 15:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-14  0:09 [PATCH] bitbake: cooker: list all nonexistent bblayer directories Oleksandr Kravchuk
2019-06-14  0:09 ` Oleksandr Kravchuk
2019-06-18 15:58   ` Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2019-06-13 23:42 Oleksandr Kravchuk
2019-06-13 23:43 ` Oleksandr Kravchuk

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.