summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-06-01 20:02:26 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-02 15:16:37 +0100
commit5fa00564b047725541a5fed95b621f0202803345 (patch)
tree1e6c99f7b4bf048d9af1d6d1af1dd7e96757d4f5
parent55b3f160b13c6db778db09476cc4c73e70c5e930 (diff)
downloadopenembedded-core-contrib-5fa00564b047725541a5fed95b621f0202803345.tar.gz
classes/create-spdx-2.2: Fix runtime dependency calculations
Fixes the runtime dependency calculations to also only follow direct dependencies of the current task instead of all transient dependencies in a similar way as the build time dependencies. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/create-spdx-2.2.bbclass13
1 files changed, 5 insertions, 8 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass
index c461c77744..f9cb3add38 100644
--- a/meta/classes/create-spdx-2.2.bbclass
+++ b/meta/classes/create-spdx-2.2.bbclass
@@ -454,7 +454,7 @@ def add_download_packages(d, doc, recipe):
# but this should be sufficient for now
doc.add_relationship(package, "BUILD_DEPENDENCY_OF", recipe)
-def collect_deps(d, dep_task):
+def collect_direct_deps(d, dep_task):
current_task = "do_" + d.getVar("BB_CURRENTTASK")
pn = d.getVar("PN")
@@ -474,8 +474,8 @@ def collect_deps(d, dep_task):
return sorted(deps)
-collect_deps[vardepsexclude] += "BB_TASKDEPDATA"
-collect_deps[vardeps] += "DEPENDS"
+collect_direct_deps[vardepsexclude] += "BB_TASKDEPDATA"
+collect_direct_deps[vardeps] += "DEPENDS"
python do_collect_spdx_deps() {
# This task calculates the build time dependencies of the recipe, and is
@@ -489,7 +489,7 @@ python do_collect_spdx_deps() {
spdx_deps_file = Path(d.getVar("SPDXDEPS"))
- deps = collect_deps(d, "do_create_spdx")
+ deps = collect_direct_deps(d, "do_create_spdx")
with spdx_deps_file.open("w") as f:
json.dump(deps, f)
@@ -710,10 +710,7 @@ def collect_package_providers(d):
providers = {}
- taskdepdata = d.getVar("BB_TASKDEPDATA", False)
- deps = sorted(set(
- (dep[0], dep[7]) for dep in taskdepdata.values() if dep[0] != d.getVar("PN")
- ))
+ deps = collect_direct_deps(d, "do_create_spdx")
deps.append((d.getVar("PN"), d.getVar("BB_HASHFILENAME")))
for dep_pn, dep_hashfn in deps: