summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2022-06-13 21:30:47 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-15 12:27:01 +0100
commitec2f329787224cd72a569cd07bc78939a96f2793 (patch)
tree3e0096f8ed4c17fac538c597676ac402a4dec5d8 /meta/lib/oe
parentee0d001b8104419798fc129c3ed9769c98b0832c (diff)
downloadpoky-ec2f329787224cd72a569cd07bc78939a96f2793.tar.gz
classes/create-spdx: Add SPDX_PRETTY option
Adds an option to make the SPDX more human-readable (at the expense of a larger files) (From OE-Core rev: 4799594b26f77ed259dc661bf077519b338390c8) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/sbom.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oe/sbom.py b/meta/lib/oe/sbom.py
index 3372f13a9d..52bf51440e 100644
--- a/meta/lib/oe/sbom.py
+++ b/meta/lib/oe/sbom.py
@@ -32,7 +32,7 @@ def get_sdk_spdxid(sdk):
32 return "SPDXRef-SDK-%s" % sdk 32 return "SPDXRef-SDK-%s" % sdk
33 33
34 34
35def write_doc(d, spdx_doc, subdir, spdx_deploy=None): 35def write_doc(d, spdx_doc, subdir, spdx_deploy=None, indent=None):
36 from pathlib import Path 36 from pathlib import Path
37 37
38 if spdx_deploy is None: 38 if spdx_deploy is None:
@@ -41,7 +41,7 @@ def write_doc(d, spdx_doc, subdir, spdx_deploy=None):
41 dest = spdx_deploy / subdir / (spdx_doc.name + ".spdx.json") 41 dest = spdx_deploy / subdir / (spdx_doc.name + ".spdx.json")
42 dest.parent.mkdir(exist_ok=True, parents=True) 42 dest.parent.mkdir(exist_ok=True, parents=True)
43 with dest.open("wb") as f: 43 with dest.open("wb") as f:
44 doc_sha1 = spdx_doc.to_json(f, sort_keys=True) 44 doc_sha1 = spdx_doc.to_json(f, sort_keys=True, indent=indent)
45 45
46 l = spdx_deploy / "by-namespace" / spdx_doc.documentNamespace.replace("/", "_") 46 l = spdx_deploy / "by-namespace" / spdx_doc.documentNamespace.replace("/", "_")
47 l.parent.mkdir(exist_ok=True, parents=True) 47 l.parent.mkdir(exist_ok=True, parents=True)