]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/create-spdx: Add index to DEPLOYDIR
authorJoshua Watt <JPEWhacker@gmail.com>
Wed, 1 Sep 2021 13:44:44 +0000 (08:44 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Sep 2021 08:03:36 +0000 (09:03 +0100)
Add the index to DEPLOYDIR in addition to adding it to the SPDX archive

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/create-spdx.bbclass

index 5adad590659eafa7fc219262b4f7cbb8a1c1ec2e..14caae8a505068e287d9a12df797d8ef634c6348 100644 (file)
@@ -674,7 +674,16 @@ python image_combine_spdx() {
 
             tar.addfile(info, fileobj=index_str)
 
-    spdx_tar_link = imgdeploydir / (image_link_name + ".spdx.tar.zst")
-    spdx_tar_link.symlink_to(os.path.relpath(spdx_tar_path, spdx_tar_link.parent))
+    def make_image_link(target_path, suffix):
+        link = imgdeploydir / (image_link_name + suffix)
+        link.symlink_to(os.path.relpath(target_path, link.parent))
+
+    make_image_link(spdx_tar_path, ".spdx.tar.zst")
+
+    spdx_index_path = imgdeploydir / (image_name + ".spdx.index.json")
+    with spdx_index_path.open("w") as f:
+        json.dump(index, f, sort_keys=True)
+
+    make_image_link(spdx_index_path, ".spdx.index.json")
 }