diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2024-10-29 22:07:43 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-01 12:07:12 +0000 |
| commit | 8f4759806ee868a32a063943059345641eb26f22 (patch) | |
| tree | b089368474236cc82d71a569ff14e705b334f887 /meta/classes/spdx-common.bbclass | |
| parent | 29c65baf76f54258ab40b75c6ad205a3ebd06316 (diff) | |
| download | poky-8f4759806ee868a32a063943059345641eb26f22.tar.gz | |
create-spdx-{2.2,3.0}: fix do_create_spdx dependency while spdx include sources
Call function ${@create_spdx_source_deps(d)} or ${create_spdx_source_deps(d)}
along with addtask not working, use task do_create_spdx flag 'depends'
to instead
Move function create_spdx_source_deps to spdx-common.bbclass for both of
create-spdx-2.2.bbclass and create-spdx-3.0.bbclass
(From OE-Core rev: dda4b7ccd416ef370634babd150e944f2aa9116e)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/spdx-common.bbclass')
| -rw-r--r-- | meta/classes/spdx-common.bbclass | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta/classes/spdx-common.bbclass b/meta/classes/spdx-common.bbclass index cd9cc0db98..ad02da5cd6 100644 --- a/meta/classes/spdx-common.bbclass +++ b/meta/classes/spdx-common.bbclass | |||
| @@ -39,6 +39,27 @@ SPDX_CUSTOM_ANNOTATION_VARS ??= "" | |||
| 39 | 39 | ||
| 40 | SPDX_MULTILIB_SSTATE_ARCHS ??= "${SSTATE_ARCHS}" | 40 | SPDX_MULTILIB_SSTATE_ARCHS ??= "${SSTATE_ARCHS}" |
| 41 | 41 | ||
| 42 | def create_spdx_source_deps(d): | ||
| 43 | import oe.spdx_common | ||
| 44 | |||
| 45 | deps = [] | ||
| 46 | if d.getVar("SPDX_INCLUDE_SOURCES") == "1": | ||
| 47 | pn = d.getVar('PN') | ||
| 48 | # do_unpack is a hack for now; we only need it to get the | ||
| 49 | # dependencies do_unpack already has so we can extract the source | ||
| 50 | # ourselves | ||
| 51 | if oe.spdx_common.has_task(d, "do_unpack"): | ||
| 52 | deps.append("%s:do_unpack" % pn) | ||
| 53 | |||
| 54 | if oe.spdx_common.is_work_shared_spdx(d) and \ | ||
| 55 | oe.spdx_common.process_sources(d): | ||
| 56 | # For kernel source code | ||
| 57 | if oe.spdx_common.has_task(d, "do_shared_workdir"): | ||
| 58 | deps.append("%s:do_shared_workdir" % pn) | ||
| 59 | |||
| 60 | return " ".join(deps) | ||
| 61 | |||
| 62 | |||
| 42 | python do_collect_spdx_deps() { | 63 | python do_collect_spdx_deps() { |
| 43 | # This task calculates the build time dependencies of the recipe, and is | 64 | # This task calculates the build time dependencies of the recipe, and is |
| 44 | # required because while a task can deptask on itself, those dependencies | 65 | # required because while a task can deptask on itself, those dependencies |
