diff options
author | Konrad Weihmann <kweihmann@witekio.com> | 2022-11-09 08:37:14 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-01 19:35:11 +0000 |
commit | 0ef7288f7e6c5befea6b9bf55548c12a40f9120d (patch) | |
tree | 73f05b15731097bf4efa6f5fe861e37ccfbce522 | |
parent | 63815831c8d9f90bc7406443d378c9213b4b8b1e (diff) | |
download | poky-0ef7288f7e6c5befea6b9bf55548c12a40f9120d.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
(From OE-Core rev: 34fa68a0b07328c4ed4eef81f8cde80137a91f18)
(From OE-Core rev: 30cdb7fbec8e9cf5c5a25e28a1102fa562a7f6c2)
Signed-off-by: Konrad Weihmann <kweihmann@witekio.com>
On-behalf-of: Avnet Embedded <AvnetEmbedded@avnet.eu>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/create-spdx.bbclass | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass index af6afcc653..f0513af083 100644 --- a/meta/classes/create-spdx.bbclass +++ b/meta/classes/create-spdx.bbclass | |||
@@ -795,6 +795,7 @@ def spdx_get_src(d): | |||
795 | bb.build.exec_func('do_unpack', d) | 795 | bb.build.exec_func('do_unpack', d) |
796 | # Copy source of kernel to spdx_workdir | 796 | # Copy source of kernel to spdx_workdir |
797 | if is_work_shared_spdx(d): | 797 | if is_work_shared_spdx(d): |
798 | share_src = d.getVar('WORKDIR') | ||
798 | d.setVar('WORKDIR', spdx_workdir) | 799 | d.setVar('WORKDIR', spdx_workdir) |
799 | d.setVar('STAGING_DIR_NATIVE', spdx_sysroot_native) | 800 | d.setVar('STAGING_DIR_NATIVE', spdx_sysroot_native) |
800 | src_dir = spdx_workdir + "/" + d.getVar('PN')+ "-" + d.getVar('PV') + "-" + d.getVar('PR') | 801 | src_dir = spdx_workdir + "/" + d.getVar('PN')+ "-" + d.getVar('PV') + "-" + d.getVar('PR') |
@@ -802,8 +803,8 @@ def spdx_get_src(d): | |||
802 | if bb.data.inherits_class('kernel',d): | 803 | if bb.data.inherits_class('kernel',d): |
803 | share_src = d.getVar('STAGING_KERNEL_DIR') | 804 | share_src = d.getVar('STAGING_KERNEL_DIR') |
804 | cmd_copy_share = "cp -rf " + share_src + "/* " + src_dir + "/" | 805 | cmd_copy_share = "cp -rf " + share_src + "/* " + src_dir + "/" |
805 | cmd_copy_kernel_result = os.popen(cmd_copy_share).read() | 806 | cmd_copy_shared_res = os.popen(cmd_copy_share).read() |
806 | bb.note("cmd_copy_kernel_result = " + cmd_copy_kernel_result) | 807 | bb.note("cmd_copy_shared_result = " + cmd_copy_shared_res) |
807 | 808 | ||
808 | git_path = src_dir + "/.git" | 809 | git_path = src_dir + "/.git" |
809 | if os.path.exists(git_path): | 810 | if os.path.exists(git_path): |