From ec2f329787224cd72a569cd07bc78939a96f2793 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Mon, 13 Jun 2022 21:30:47 -0500 Subject: 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 Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/lib/oe/sbom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'meta/lib') 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): return "SPDXRef-SDK-%s" % sdk -def write_doc(d, spdx_doc, subdir, spdx_deploy=None): +def write_doc(d, spdx_doc, subdir, spdx_deploy=None, indent=None): from pathlib import Path if spdx_deploy is None: @@ -41,7 +41,7 @@ def write_doc(d, spdx_doc, subdir, spdx_deploy=None): dest = spdx_deploy / subdir / (spdx_doc.name + ".spdx.json") dest.parent.mkdir(exist_ok=True, parents=True) with dest.open("wb") as f: - doc_sha1 = spdx_doc.to_json(f, sort_keys=True) + doc_sha1 = spdx_doc.to_json(f, sort_keys=True, indent=indent) l = spdx_deploy / "by-namespace" / spdx_doc.documentNamespace.replace("/", "_") l.parent.mkdir(exist_ok=True, parents=True) -- cgit v1.2.3-54-g00ecf