aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-09-01 08:44:44 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-03 09:03:36 +0100
commit374dc08c0f22e98a267676f71308592d17f77d64 (patch)
treebce7b6e72b604f77479b75af8e04d6464a629d4a
parentebfe78ad26b643ce0fb22ba5b3ede43da4a78987 (diff)
downloadopenembedded-core-contrib-374dc08c0f22e98a267676f71308592d17f77d64.tar.gz
openembedded-core-contrib-374dc08c0f22e98a267676f71308592d17f77d64.tar.bz2
openembedded-core-contrib-374dc08c0f22e98a267676f71308592d17f77d64.zip
classes/create-spdx: Add index to DEPLOYDIR
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>
-rw-r--r--meta/classes/create-spdx.bbclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass
index 5adad59065..14caae8a50 100644
--- a/meta/classes/create-spdx.bbclass
+++ b/meta/classes/create-spdx.bbclass
@@ -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")
}