]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
classes/create-spdx-2.2: Show error if document is not found
authorJoshua Watt <JPEWhacker@gmail.com>
Thu, 28 Sep 2023 18:34:13 +0000 (12:34 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 29 Sep 2023 22:07:43 +0000 (23:07 +0100)
As in other places, print a more helpful error if a SPDX document is not
found when assembling documents for the final SPDX archive.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/classes/create-spdx-2.2.bbclass

index 3ee1b7ee0d8f3c65e34e9efa4bcbacc6f3e61cea..b0aef80db16e466620bdf9fdaee59c855ef02f77 100644 (file)
@@ -1131,6 +1131,8 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx
 
                 for ref in doc.externalDocumentRefs:
                     ref_path = oe.sbom.doc_find_by_namespace(deploy_dir_spdx, package_archs, ref.spdxDocument)
+                    if not ref_path:
+                        bb.fatal("Cannot find any SPDX file for document %s" % ref.spdxDocument)
                     collect_spdx_document(ref_path)
 
             collect_spdx_document(image_spdx_path)