]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
spdx: Use checksum list from bitbake
authorJoshua Watt <jpewhacker@gmail.com>
Wed, 13 May 2026 15:00:57 +0000 (09:00 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 18 May 2026 22:19:13 +0000 (23:19 +0100)
Instead of manually curating a hardcoded list of checksums, use the same
list that bitbake uses.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/spdx30_tasks.py

index 1821dd7de4a9483628eb311d5bf9ad801754858f..0a30be576795a02242f7ab04106bea812298cdfc 100644 (file)
@@ -547,8 +547,10 @@ def add_download_files(d, objset):
             _enrich_source_package(d, dl, fd, file_name, primary_purpose)
 
             if fd.method.supports_checksum(fd):
-                # TODO Need something better than hard coding this
-                for checksum_id in ["sha256", "sha1"]:
+                for checksum_id in bb.fetch2.CHECKSUM_LIST:
+                    if checksum_id not in oe.spdx30.HashAlgorithm.NAMED_INDIVIDUALS:
+                        continue
+
                     expected_checksum = getattr(fd, "%s_expected" % checksum_id, None)
                     if expected_checksum is None:
                         continue