diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-06-01 20:02:26 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-02 15:59:07 +0100 |
commit | 819596507c9d339c0b54647ae01997d7b5adf3f1 (patch) | |
tree | e386011b751e11ac154114afdc2a9f0256703ea5 /meta/classes | |
parent | 15acbd10906568a1ed9c548b465f1cb6b5205202 (diff) | |
download | poky-819596507c9d339c0b54647ae01997d7b5adf3f1.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.
(From OE-Core rev: 5fa00564b047725541a5fed95b621f0202803345)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.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 | 13 |
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): | |||
454 | # but this should be sufficient for now | 454 | # but this should be sufficient for now |
455 | doc.add_relationship(package, "BUILD_DEPENDENCY_OF", recipe) | 455 | doc.add_relationship(package, "BUILD_DEPENDENCY_OF", recipe) |
456 | 456 | ||
457 | def collect_deps(d, dep_task): | 457 | def collect_direct_deps(d, dep_task): |
458 | current_task = "do_" + d.getVar("BB_CURRENTTASK") | 458 | current_task = "do_" + d.getVar("BB_CURRENTTASK") |
459 | pn = d.getVar("PN") | 459 | pn = d.getVar("PN") |
460 | 460 | ||
@@ -474,8 +474,8 @@ def collect_deps(d, dep_task): | |||
474 | 474 | ||
475 | return sorted(deps) | 475 | return sorted(deps) |
476 | 476 | ||
477 | collect_deps[vardepsexclude] += "BB_TASKDEPDATA" | 477 | collect_direct_deps[vardepsexclude] += "BB_TASKDEPDATA" |
478 | collect_deps[vardeps] += "DEPENDS" | 478 | collect_direct_deps[vardeps] += "DEPENDS" |
479 | 479 | ||
480 | python do_collect_spdx_deps() { | 480 | python do_collect_spdx_deps() { |
481 | # This task calculates the build time dependencies of the recipe, and is | 481 | # This task calculates the build time dependencies of the recipe, and is |
@@ -489,7 +489,7 @@ python do_collect_spdx_deps() { | |||
489 | 489 | ||
490 | spdx_deps_file = Path(d.getVar("SPDXDEPS")) | 490 | spdx_deps_file = Path(d.getVar("SPDXDEPS")) |
491 | 491 | ||
492 | deps = collect_deps(d, "do_create_spdx") | 492 | deps = collect_direct_deps(d, "do_create_spdx") |
493 | 493 | ||
494 | with spdx_deps_file.open("w") as f: | 494 | with spdx_deps_file.open("w") as f: |
495 | json.dump(deps, f) | 495 | json.dump(deps, f) |
@@ -710,10 +710,7 @@ def collect_package_providers(d): | |||
710 | 710 | ||
711 | providers = {} | 711 | providers = {} |
712 | 712 | ||
713 | taskdepdata = d.getVar("BB_TASKDEPDATA", False) | 713 | deps = collect_direct_deps(d, "do_create_spdx") |
714 | deps = sorted(set( | ||
715 | (dep[0], dep[7]) for dep in taskdepdata.values() if dep[0] != d.getVar("PN") | ||
716 | )) | ||
717 | deps.append((d.getVar("PN"), d.getVar("BB_HASHFILENAME"))) | 714 | deps.append((d.getVar("PN"), d.getVar("BB_HASHFILENAME"))) |
718 | 715 | ||
719 | for dep_pn, dep_hashfn in deps: | 716 | for dep_pn, dep_hashfn in deps: |