bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer
@ 2023-02-13 13:55 pedro.miguel.baptista
  2023-02-13 13:55 ` [bitbake][PATCHv2 2/2] action.py: add BBPATH in bblayers_conf path for remove-layer pedro.miguel.baptista
  2023-02-15 10:07 ` [bitbake-devel] [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer Richard Purdie
  0 siblings, 2 replies; 3+ messages in thread
From: pedro.miguel.baptista @ 2023-02-13 13:55 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Pedro Baptista

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..a2208db0bc 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['BBPATH'], 'conf', 'bblayers.conf')
         if not os.path.exists(bblayers_conf):
             sys.stderr.write("Unable to find bblayers.conf\n")
             return 1
-- 
2.34.1



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

* [bitbake][PATCHv2 2/2] action.py: add BBPATH in bblayers_conf path for remove-layer
  2023-02-13 13:55 [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer pedro.miguel.baptista
@ 2023-02-13 13:55 ` pedro.miguel.baptista
  2023-02-15 10:07 ` [bitbake-devel] [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer Richard Purdie
  1 sibling, 0 replies; 3+ messages in thread
From: pedro.miguel.baptista @ 2023-02-13 13:55 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Pedro Baptista

From: Pedro Baptista <pedro.miguel.baptista@gmail.com>

By including the full path to bblayers.conf the remove-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 a2208db0bc..dab4dc0107 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -65,7 +65,7 @@ class ActionPlugin(LayerPlugin):
 
     def do_remove_layer(self, args):
         """Remove one or more layers from bblayers.conf."""
-        bblayers_conf = os.path.join('conf', 'bblayers.conf')
+        bblayers_conf = os.path.join(os.environ['BBPATH'], 'conf', 'bblayers.conf')
         if not os.path.exists(bblayers_conf):
             sys.stderr.write("Unable to find bblayers.conf\n")
             return 1
-- 
2.34.1



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

* Re: [bitbake-devel] [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer
  2023-02-13 13:55 [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer pedro.miguel.baptista
  2023-02-13 13:55 ` [bitbake][PATCHv2 2/2] action.py: add BBPATH in bblayers_conf path for remove-layer pedro.miguel.baptista
@ 2023-02-15 10:07 ` Richard Purdie
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2023-02-15 10:07 UTC (permalink / raw)
  To: Pedro Baptista, bitbake-devel

On Mon, 2023-02-13 at 13:55 +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..a2208db0bc 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['BBPATH'], 'conf', 'bblayers.conf')
>          if not os.path.exists(bblayers_conf):
>              sys.stderr.write("Unable to find bblayers.conf\n")
>              return 1

Whilst that is an improvement, I was really suggesting using something
like lib/bb/cookerdata.py:findConfigFile() as done in findTopdir() in
that file.

That way we use the same behaviour everywhere.

Cheers,

Richard



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

end of thread, other threads:[~2023-02-15 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13 13:55 [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer pedro.miguel.baptista
2023-02-13 13:55 ` [bitbake][PATCHv2 2/2] action.py: add BBPATH in bblayers_conf path for remove-layer pedro.miguel.baptista
2023-02-15 10:07 ` [bitbake-devel] [bitbake][PATCHv2 1/2] action.py: add BBPATH in bblayers_conf path for add-layer Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).