Skip to contentSkip to conversation

action.py: add BUILDDIR in bblayers_conf path for add-layer

PATCH Superseded [email protected] 2 participants 3 messages Feb 12, 2023 – Feb 13, 2023

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

From: Pedro Baptista <[email protected]>

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

---
 bitbake/lib/bblayers/action.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bblayers/action.py +1 -1
index 454c251410..76a2c5acd2 100644
@@ -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
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 action.py: add BUILDDIR in bblayers_conf path for remove-layer

From: Pedro Baptista <[email protected]>

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

---
 bitbake/lib/bblayers/action.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bblayers/action.py +1 -1
index 76a2c5acd2..f26b34d0cb 100644
@@ -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['BUILDDIR'], 'conf', 'bblayers.conf')
         if not os.path.exists(bblayers_conf):
             sys.stderr.write("Unable to find bblayers.conf\n")
             return 1
Signature · 1 line
2.34.1
#2 lore raw
In reply to [email protected]
Quoted 16 lines · Pedro Baptista

From: Pedro Baptista <[email protected]>

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

---
 bitbake/lib/bblayers/action.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bblayers/action.py +0 -0
index 454c251410..76a2c5acd2 100644

bitbake/lib/bblayers/action.py class ActionPlugin(LayerPlugin): · line 43

Quoted 8 lines
bitbake/lib/bblayers/action.py +1 -1
@@ -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