mirror of
https://git.yoctoproject.org/poky
synced 2026-04-27 21:32:13 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
29c65baf76
commit
8f4759806e
@@ -584,7 +584,10 @@ addtask do_create_spdx_setscene
|
||||
|
||||
do_create_spdx[dirs] = "${SPDXWORK}"
|
||||
do_create_spdx[cleandirs] = "${SPDXDEPLOY} ${SPDXWORK}"
|
||||
do_create_spdx[depends] += "${PATCHDEPENDENCY}"
|
||||
do_create_spdx[depends] += " \
|
||||
${PATCHDEPENDENCY} \
|
||||
${@create_spdx_source_deps(d)} \
|
||||
"
|
||||
|
||||
python do_create_runtime_spdx() {
|
||||
from datetime import datetime, timezone
|
||||
|
||||
@@ -132,22 +132,8 @@ addtask do_create_spdx after \
|
||||
do_collect_spdx_deps \
|
||||
do_deploy_source_date_epoch \
|
||||
do_populate_sysroot do_package do_packagedata \
|
||||
${create_spdx_source_deps(d)} \
|
||||
before do_populate_sdk do_populate_sdk_ext do_build do_rm_work
|
||||
|
||||
def create_spdx_source_deps(d):
|
||||
deps = []
|
||||
if d.getVar("SPDX_INCLUDE_SOURCES") == "1":
|
||||
deps.extend([
|
||||
# do_unpack is a hack for now; we only need it to get the
|
||||
# dependencies do_unpack already has so we can extract the source
|
||||
# ourselves
|
||||
"do_unpack",
|
||||
# For kernel source code
|
||||
"do_shared_workdir",
|
||||
])
|
||||
return " ".join(deps)
|
||||
|
||||
SSTATETASKS += "do_create_spdx"
|
||||
do_create_spdx[sstate-inputdirs] = "${SPDXDEPLOY}"
|
||||
do_create_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}"
|
||||
@@ -159,7 +145,10 @@ addtask do_create_spdx_setscene
|
||||
|
||||
do_create_spdx[dirs] = "${SPDXWORK}"
|
||||
do_create_spdx[cleandirs] = "${SPDXDEPLOY} ${SPDXWORK}"
|
||||
do_create_spdx[depends] += "${PATCHDEPENDENCY}"
|
||||
do_create_spdx[depends] += " \
|
||||
${PATCHDEPENDENCY} \
|
||||
${@create_spdx_source_deps(d)} \
|
||||
"
|
||||
|
||||
python do_create_package_spdx() {
|
||||
import oe.spdx30_tasks
|
||||
|
||||
@@ -39,6 +39,27 @@ SPDX_CUSTOM_ANNOTATION_VARS ??= ""
|
||||
|
||||
SPDX_MULTILIB_SSTATE_ARCHS ??= "${SSTATE_ARCHS}"
|
||||
|
||||
def create_spdx_source_deps(d):
|
||||
import oe.spdx_common
|
||||
|
||||
deps = []
|
||||
if d.getVar("SPDX_INCLUDE_SOURCES") == "1":
|
||||
pn = d.getVar('PN')
|
||||
# do_unpack is a hack for now; we only need it to get the
|
||||
# dependencies do_unpack already has so we can extract the source
|
||||
# ourselves
|
||||
if oe.spdx_common.has_task(d, "do_unpack"):
|
||||
deps.append("%s:do_unpack" % pn)
|
||||
|
||||
if oe.spdx_common.is_work_shared_spdx(d) and \
|
||||
oe.spdx_common.process_sources(d):
|
||||
# For kernel source code
|
||||
if oe.spdx_common.has_task(d, "do_shared_workdir"):
|
||||
deps.append("%s:do_shared_workdir" % pn)
|
||||
|
||||
return " ".join(deps)
|
||||
|
||||
|
||||
python do_collect_spdx_deps() {
|
||||
# This task calculates the build time dependencies of the recipe, and is
|
||||
# required because while a task can deptask on itself, those dependencies
|
||||
|
||||
@@ -226,6 +226,10 @@ def get_patched_src(d):
|
||||
d.setVar("WORKDIR", workdir)
|
||||
|
||||
|
||||
def has_task(d, task):
|
||||
return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
|
||||
|
||||
|
||||
def fetch_data_to_uri(fd, name):
|
||||
"""
|
||||
Translates a bitbake FetchData to a string URI
|
||||
|
||||
Reference in New Issue
Block a user