]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oe/sbom30: Simplify sorting of license_text_map
authorBenjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Mon, 20 Apr 2026 07:44:33 +0000 (09:44 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Apr 2026 16:58:37 +0000 (17:58 +0100)
In new_license_expression() the code used to sort the license_text_map
dictionary can be simplified.

Signed-off-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/sbom30.py

index 9f50821af087de338e683dfa538ca014fa27d0b8..f45d8f6773ba6f8931411edb65881f285d9f2300 100644 (file)
@@ -585,9 +585,7 @@ class ObjectSet(oe.spdx30.SHACLObjectSet):
             re.sub(r"[^a-zA-Z0-9_-]", "_", license_expression),
         ]
 
-        license_text = [
-            (k, license_text_map[k]) for k in sorted(license_text_map.keys())
-        ]
+        license_text = sorted(license_text_map.items(), key=lambda t: t[0])
 
         if not license_text:
             lic = self.find_filter(