diff options
author | Konrad Weihmann <kweihmann@witekio.com> | 2022-11-09 08:37:14 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-11 13:43:40 +0000 |
commit | f260b288020f07fdf0616d245691b2e40b6b6b4b (patch) | |
tree | 7186807a4ed0aaf7438ca4efc97159f9eb1b4bd1 /meta/classes | |
parent | 02691744256d4f267f37190e30b03b3bc3e477fc (diff) | |
download | poky-f260b288020f07fdf0616d245691b2e40b6b6b4b.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)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 5 |
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): | |||
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): |