lib/spdx30_tasks: Report all missing providers

Instead of failing on the first missing provider, collect all of them
and report them all as it is more convenient for end users trying to fix
problems

(From OE-Core rev: fc96244f424c8b4fbace39dc4af8a4e97f1a104e)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Watt authored and Richard Purdie committed 2024-09-04 12:38:44 +01:00
1 parent 5f1d7da2c4
commit 819ee3eff3
1 file changed
+8 -1
+8 -1
View File
@@ -953,10 +953,12 @@ def collect_build_package_inputs(d, objset, build, packages):
providers = oe.spdx_common.collect_package_providers(d)
build_deps = set()
missing_providers = set()
for name in sorted(packages.keys()):
if name not in providers:
bb.fatal("Unable to find SPDX provider for '%s'" % name)
missing_providers.add(name)
continue
pkg_name, pkg_hashfn = providers[name]
@@ -970,6 +972,11 @@ def collect_build_package_inputs(d, objset, build, packages):
)
build_deps.add(pkg_spdx._id)
if missing_providers:
bb.fatal(
f"Unable to find SPDX provider(s) for: {', '.join(sorted(missing_providers))}"
)
if build_deps:
objset.new_scoped_relationship(
[build],