Skip to content

Commit 1900dc1

Browse files
JPEWdevrpurdie
authored andcommitted
classes: create-spdx-2.2: Fix dependency handling
The common SPDX code was changed to return a dataclass for dependency information instead of a namedtuple, but the SPDX 2.2 was missed to account for this. Correct the SPDX 2.2 code to correctly handle the new datatype Signed-off-by: Joshua Watt <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent b954a84 commit 1900dc1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

meta/classes/create-spdx-2.2.bbclass

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,21 +279,21 @@ def collect_dep_recipes(d, doc, spdx_recipe):
279279

280280
deps = oe.spdx_common.get_spdx_deps(d)
281281

282-
for dep_pn, dep_hashfn, in_taskhash in deps:
282+
for dep in deps:
283283
# If this dependency is not calculated in the taskhash skip it.
284284
# Otherwise, it can result in broken links since this task won't
285285
# rebuild and see the new SPDX ID if the dependency changes
286-
if not in_taskhash:
286+
if not dep.in_taskhash:
287287
continue
288288

289-
dep_recipe_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, "recipe-" + dep_pn, dep_hashfn)
289+
dep_recipe_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, "recipe-" + dep.pn, dep.hashfn)
290290
if not dep_recipe_path:
291-
bb.fatal("Cannot find any SPDX file for recipe %s, %s" % (dep_pn, dep_hashfn))
291+
bb.fatal("Cannot find any SPDX file for recipe %s, %s" % (dep.pn, dep.hashfn))
292292

293293
spdx_dep_doc, spdx_dep_sha1 = oe.sbom.read_doc(dep_recipe_path)
294294

295295
for pkg in spdx_dep_doc.packages:
296-
if pkg.name == dep_pn:
296+
if pkg.name == dep.pn:
297297
spdx_dep_recipe = pkg
298298
break
299299
else:

0 commit comments

Comments
 (0)