classes/create-spdx-2.2: Handle empty packages

When combining an SPDX document, the package list might be empty (e.g.
a baremetal image). Handle this case instead of erroring out

(From OE-Core rev: baf4e360f6e65a5e9aff2def69d2a720f38f92b2)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Watt
2024-07-12 09:58:21 -06:00
committed by Richard Purdie
parent 666c1f1048
commit 2c2e1becd6

View File

@@ -811,6 +811,7 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx
doc.packages.append(image) doc.packages.append(image)
if packages:
for name in sorted(packages.keys()): for name in sorted(packages.keys()):
if name not in providers: if name not in providers:
bb.fatal("Unable to find SPDX provider for '%s'" % name) bb.fatal("Unable to find SPDX provider for '%s'" % name)