diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index 4ea91f6499..7c8a0b8b0f 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass | |||
@@ -357,7 +357,13 @@ def collect_dep_recipes(d, doc, spdx_recipe): | |||
357 | with spdx_deps_file.open("r") as f: | 357 | with spdx_deps_file.open("r") as f: |
358 | deps = json.load(f) | 358 | deps = json.load(f) |
359 | 359 | ||
360 | for dep_pn, dep_hashfn in deps: | 360 | for dep_pn, dep_hashfn, in_taskhash in deps: |
361 | # If this dependency is not calculated in the taskhash skip it. | ||
362 | # Otherwise, it can result in broken links since this task won't | ||
363 | # rebuild and see the new SPDX ID if the dependency changes | ||
364 | if not in_taskhash: | ||
365 | continue | ||
366 | |||
361 | dep_recipe_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, "recipe-" + dep_pn, dep_hashfn) | 367 | dep_recipe_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, "recipe-" + dep_pn, dep_hashfn) |
362 | if not dep_recipe_path: | 368 | if not dep_recipe_path: |
363 | bb.fatal("Cannot find any SPDX file for recipe %s, %s" % (dep_pn, dep_hashfn)) | 369 | bb.fatal("Cannot find any SPDX file for recipe %s, %s" % (dep_pn, dep_hashfn)) |
@@ -478,7 +484,7 @@ def collect_direct_deps(d, dep_task): | |||
478 | for dep_name in this_dep[3]: | 484 | for dep_name in this_dep[3]: |
479 | dep_data = taskdepdata[dep_name] | 485 | dep_data = taskdepdata[dep_name] |
480 | if dep_data[1] == dep_task and dep_data[0] != pn: | 486 | if dep_data[1] == dep_task and dep_data[0] != pn: |
481 | deps.add((dep_data[0], dep_data[7])) | 487 | deps.add((dep_data[0], dep_data[7], dep_name in this_dep[8])) |
482 | 488 | ||
483 | return sorted(deps) | 489 | return sorted(deps) |
484 | 490 | ||
@@ -721,9 +727,9 @@ def collect_package_providers(d): | |||
721 | providers = {} | 727 | providers = {} |
722 | 728 | ||
723 | deps = collect_direct_deps(d, "do_create_spdx") | 729 | deps = collect_direct_deps(d, "do_create_spdx") |
724 | deps.append((d.getVar("PN"), d.getVar("BB_HASHFILENAME"))) | 730 | deps.append((d.getVar("PN"), d.getVar("BB_HASHFILENAME"), True)) |
725 | 731 | ||
726 | for dep_pn, dep_hashfn in deps: | 732 | for dep_pn, dep_hashfn, _ in deps: |
727 | localdata = d | 733 | localdata = d |
728 | recipe_data = oe.packagedata.read_pkgdata(dep_pn, localdata) | 734 | recipe_data = oe.packagedata.read_pkgdata(dep_pn, localdata) |
729 | if not recipe_data: | 735 | if not recipe_data: |