summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@witekio.com>2022-11-09 08:37:14 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-11 13:43:36 +0000
commit34fa68a0b07328c4ed4eef81f8cde80137a91f18 (patch)
tree05ad13056972f0938669326ac7dcf14c8680a08f /meta/classes
parent9ec01fe3e59be66331c14ab5391ecb0b6f140c22 (diff)
downloadopenembedded-core-34fa68a0b07328c4ed4eef81f8cde80137a91f18.tar.gz
create-spdx: default share_src for shared sources
if a source is using work-shared but isn't a kernel, like for instance llvm-source from meta-clang, share_src was previously undefined leading to a crash of the python code. Default to WORKDIR and just override it in case the source being a kernel recipe. Additionally changes the variable names in the following, as they imply that it's only about the kernel, which is not the case in every case Signed-off-by: Konrad Weihmann <kweihmann@witekio.com> On-behalf-of: Avnet Embedded <AvnetEmbedded@avnet.eu> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/create-spdx-2.2.bbclass5
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass
index af6afcc653..f0513af083 100644
--- a/meta/classes/create-spdx-2.2.bbclass
+++ b/meta/classes/create-spdx-2.2.bbclass
@@ -795,6 +795,7 @@ def spdx_get_src(d):
bb.build.exec_func('do_unpack', d)
# Copy source of kernel to spdx_workdir
if is_work_shared_spdx(d):
+ share_src = d.getVar('WORKDIR')
d.setVar('WORKDIR', spdx_workdir)
d.setVar('STAGING_DIR_NATIVE', spdx_sysroot_native)
src_dir = spdx_workdir + "/" + d.getVar('PN')+ "-" + d.getVar('PV') + "-" + d.getVar('PR')
@@ -802,8 +803,8 @@ def spdx_get_src(d):
if bb.data.inherits_class('kernel',d):
share_src = d.getVar('STAGING_KERNEL_DIR')
cmd_copy_share = "cp -rf " + share_src + "/* " + src_dir + "/"
- cmd_copy_kernel_result = os.popen(cmd_copy_share).read()
- bb.note("cmd_copy_kernel_result = " + cmd_copy_kernel_result)
+ cmd_copy_shared_res = os.popen(cmd_copy_share).read()
+ bb.note("cmd_copy_shared_result = " + cmd_copy_shared_res)
git_path = src_dir + "/.git"
if os.path.exists(git_path):