Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 2 messages Feb 15, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 action.py: add topdir 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bblayers/action.py +2 -1
index 454c251410..d1ba101de2 100644
@@ -11,6 +11,7 @@ import shutil
 import sys
 import tempfile
 
+from bb.cookerdata import findTopdir
 import bb.utils
 
 from bblayers.common import LayerPlugin
@@ -37,7 +38,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(findTopdir(),'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 v3 2/2 action.py: add topdir 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 d1ba101de2..0d7fd6edd1 100644
@@ -66,7 +66,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(findTopdir() ,'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