summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaul Wold <Saul.Wold@windriver.com>2021-11-17 10:08:13 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-24 21:12:50 +0000
commit07c12415c6b7af0bfca8e5d5d06b437f2f631f8b (patch)
tree848c246630d4ec43914dbff647f9a7e64642198b
parent10a700c094a2ef693f0b4ee0de374a42112dfef3 (diff)
downloadpoky-07c12415c6b7af0bfca8e5d5d06b437f2f631f8b.tar.gz
create_spdx: ensure is_work_shared() is unique
There is a function with the same name is_work_shared() in the archiver class this causes a conflict when both classes are included. Use work-shared as the check in WORKDIR to allow for other packages beyond the kernel and gcc that use a common shared-work source directory. (From OE-Core rev: 1d350fd2a0db57617fbc62eb1d65f3ffa2667551) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 18eab77ee65c73b17225e69c7ba446ab1c69fa92) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/create-spdx.bbclass12
1 files changed, 5 insertions, 7 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass
index eb1d446f3f..1d5c8b3bc1 100644
--- a/meta/classes/create-spdx.bbclass
+++ b/meta/classes/create-spdx.bbclass
@@ -53,10 +53,8 @@ def recipe_spdx_is_native(d, recipe):
53 a.annotator == "Tool: %s - %s" % (d.getVar("SPDX_TOOL_NAME"), d.getVar("SPDX_TOOL_VERSION")) and 53 a.annotator == "Tool: %s - %s" % (d.getVar("SPDX_TOOL_NAME"), d.getVar("SPDX_TOOL_VERSION")) and
54 a.comment == "isNative" for a in recipe.annotations) 54 a.comment == "isNative" for a in recipe.annotations)
55 55
56def is_work_shared(d): 56def is_work_shared_spdx(d):
57 pn = d.getVar('PN') 57 return bb.data.inherits_class('kernel', d) or ('work-shared' in d.getVar('WORKDIR'))
58 return bb.data.inherits_class('kernel', d) or pn.startswith('gcc-source')
59
60 58
61python() { 59python() {
62 import json 60 import json
@@ -747,7 +745,7 @@ def spdx_get_src(d):
747 745
748 try: 746 try:
749 # The kernel class functions require it to be on work-shared, so we dont change WORKDIR 747 # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
750 if not is_work_shared(d): 748 if not is_work_shared_spdx(d):
751 # Change the WORKDIR to make do_unpack do_patch run in another dir. 749 # Change the WORKDIR to make do_unpack do_patch run in another dir.
752 d.setVar('WORKDIR', spdx_workdir) 750 d.setVar('WORKDIR', spdx_workdir)
753 # Restore the original path to recipe's native sysroot (it's relative to WORKDIR). 751 # Restore the original path to recipe's native sysroot (it's relative to WORKDIR).
@@ -760,7 +758,7 @@ def spdx_get_src(d):
760 758
761 bb.build.exec_func('do_unpack', d) 759 bb.build.exec_func('do_unpack', d)
762 # Copy source of kernel to spdx_workdir 760 # Copy source of kernel to spdx_workdir
763 if is_work_shared(d): 761 if is_work_shared_spdx(d):
764 d.setVar('WORKDIR', spdx_workdir) 762 d.setVar('WORKDIR', spdx_workdir)
765 d.setVar('STAGING_DIR_NATIVE', spdx_sysroot_native) 763 d.setVar('STAGING_DIR_NATIVE', spdx_sysroot_native)
766 src_dir = spdx_workdir + "/" + d.getVar('PN')+ "-" + d.getVar('PV') + "-" + d.getVar('PR') 764 src_dir = spdx_workdir + "/" + d.getVar('PN')+ "-" + d.getVar('PV') + "-" + d.getVar('PR')
@@ -776,7 +774,7 @@ def spdx_get_src(d):
776 shutils.rmtree(git_path) 774 shutils.rmtree(git_path)
777 775
778 # Make sure gcc and kernel sources are patched only once 776 # Make sure gcc and kernel sources are patched only once
779 if not (d.getVar('SRC_URI') == "" or is_work_shared(d)): 777 if not (d.getVar('SRC_URI') == "" or is_work_shared_spdx(d)):
780 bb.build.exec_func('do_patch', d) 778 bb.build.exec_func('do_patch', d)
781 779
782 # Some userland has no source. 780 # Some userland has no source.