]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
classes/sbom-cve-check: use named variables when iterating
authorRoss Burton <ross.burton@arm.com>
Wed, 1 Apr 2026 16:54:46 +0000 (17:54 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Apr 2026 12:10:36 +0000 (13:10 +0100)
Little cleanups: unpack when iterating to avoid needing to use indexes,
and only update symlinks if update_link is not None.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/sbom-cve-check.bbclass

index 2a8429d0b1cabe4a62556bf255e8ca0d9989e92a..f9f646110048301a79381168adaf888f842d318f 100644 (file)
@@ -71,9 +71,9 @@ python do_sbom_cve_check() {
         "--disable-auto-updates"
     ]
 
-    for export_file in export_files:
+    for export_type, export_file, export_link in export_files:
         cmd_args.extend(
-            ["--export-type", export_file[0], "--export-path", export_file[1]]
+            ["--export-type", export_type, "--export-path", export_file]
         )
 
     cmd_args.extend(d.getVar("SBOM_CVE_CHECK_EXTRA_ARGS").split())
@@ -85,9 +85,10 @@ python do_sbom_cve_check() {
         bb.error(f"sbom-cve-check failed: {e}")
         return
 
-    for export_file in export_files:
-        bb.note(f"sbom-cve-check exported: {export_file[1]}")
-        update_symlinks(export_file[1], export_file[2])
+    for export_type, export_file, export_link in export_files:
+        bb.note(f"sbom-cve-check exported: {export_file}")
+        if export_link:
+            update_symlinks(export_file, export_link)
 }
 
 addtask do_sbom_cve_check after do_create_image_sbom_spdx before do_build