summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/copy_buildsystem.py
diff options
context:
space:
mode:
authorDaniel Wagenknecht <dwagenknecht@emlix.com>2022-03-02 20:05:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-04 17:13:06 +0000
commit16d330d42e03085769eddb1b60ba1df7228baf36 (patch)
tree7df286c520962042602f7e06c9473cfc1566c5ef /meta/lib/oe/copy_buildsystem.py
parentab8ed74082ffaf3b3adca84f4c41465f89657e76 (diff)
downloadopenembedded-core-16d330d42e03085769eddb1b60ba1df7228baf36.tar.gz
copy_buildsystem: allow more layer paths
Layers could be located anywhere. The eSDK should work with them even if they are not located in TOPDIR or in the same parent directory as COREBASE. For layers located in the same parent directory as COREBASE this preserves the intent from the previous copy_buildsystem: include layer tree during build structure creation commit. Related OE-Core rev: 5a59a6997f41e606d088e3e86812de56f72f543b Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/copy_buildsystem.py')
-rw-r--r--meta/lib/oe/copy_buildsystem.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index d97bf9d1b9..79642fd76a 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -45,9 +45,6 @@ class BuildSystem(object):
corebase = os.path.abspath(self.d.getVar('COREBASE'))
layers.append(corebase)
- # Get relationship between TOPDIR and COREBASE
- # Layers should respect it
- corebase_relative = os.path.dirname(os.path.relpath(os.path.abspath(self.d.getVar('TOPDIR')), corebase))
# The bitbake build system uses the meta-skeleton layer as a layout
# for common recipies, e.g: the recipetool script to create kernel recipies
# Add the meta-skeleton layer to be included as part of the eSDK installation
@@ -100,11 +97,10 @@ class BuildSystem(object):
layerdestpath = destdir
if corebase == os.path.dirname(layer):
layerdestpath += '/' + os.path.basename(corebase)
- else:
- layer_relative = os.path.relpath(layer, corebase)
- if os.path.dirname(layer_relative) == corebase_relative:
- layer_relative = os.path.dirname(corebase_relative) + '/' + layernewname
- layer_relative = os.path.basename(corebase) + '/' + layer_relative
+ # If the layer is located somewhere under the same parent directory
+ # as corebase we keep the layer structure.
+ elif os.path.commonpath([layer, corebase]) == os.path.dirname(corebase):
+ layer_relative = os.path.relpath(layer, os.path.dirname(corebase))
if os.path.dirname(layer_relative) != layernewname:
layerdestpath += '/' + os.path.dirname(layer_relative)