diff mbox series

[1/2] action.py: add BUILDDIR in bblayers_conf path for add-layer

Message ID 20230212002024.5430-1-pedro.miguel.baptista@gmail.com
State New
Headers show
Series [1/2] action.py: add BUILDDIR in bblayers_conf path for add-layer | expand

Commit Message

pedro.miguel.baptista@gmail.com Feb. 12, 2023, 12:20 a.m. UTC
From: Pedro Baptista <pedro.miguel.baptista@gmail.com>

By including the full path to bblayers.conf the add-layer
command can be executed from any location, not only from the
build directory.

Signed-off-by: Pedro Baptista <pedro.miguel.baptista@gmail.com>
---
 bitbake/lib/bblayers/action.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie Feb. 13, 2023, 7:53 a.m. UTC | #1
On Sun, 2023-02-12 at 00:20 +0000, Pedro Baptista wrote:
> From: Pedro Baptista <pedro.miguel.baptista@gmail.com>
> 
> By including the full path to bblayers.conf the add-layer
> command can be executed from any location, not only from the
> build directory.
> 
> Signed-off-by: Pedro Baptista <pedro.miguel.baptista@gmail.com>
> ---
>  bitbake/lib/bblayers/action.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
> index 454c251410..76a2c5acd2 100644
> --- a/bitbake/lib/bblayers/action.py
> +++ b/bitbake/lib/bblayers/action.py
> @@ -37,7 +37,7 @@ class ActionPlugin(LayerPlugin):
>                  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')
> +        bblayers_conf = os.path.join(os.environ['BUILDDIR'], 'conf', 'bblayers.conf')
>          if not os.path.exists(bblayers_conf):
>              sys.stderr.write("Unable to find bblayers.conf\n")
>              return 1

We need the logic to be consistent with how bitbake itself finds
bblayers.conf. Bitbake doesn't know about BUILDDIR, I think it uses
BBAPTH. We should try and share the same logic.

Cheers,

Richard
diff mbox series

Patch

diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index 454c251410..76a2c5acd2 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -37,7 +37,7 @@  class ActionPlugin(LayerPlugin):
                 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')
+        bblayers_conf = os.path.join(os.environ['BUILDDIR'], 'conf', 'bblayers.conf')
         if not os.path.exists(bblayers_conf):
             sys.stderr.write("Unable to find bblayers.conf\n")
             return 1