Skip to content

Commit

Permalink
Be more MS-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Sep 19, 2024
1 parent a41e405 commit f8d1575
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions manifest.spdx.json → _manifest/spdx_2.2/manifest.spdx.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"SPDXID": "SPDXRef-DOCUMENT",
"spdxVersion": "SPDX-2.3",
"spdxVersion": "SPDX-2.2",
"creationInfo": {
"comment": "This document has been automatically generated.",
"creators": [
"Tool: /Users/simon/others-repos/noto-cjk/generate-manifest.py-0.0.1"
],
"created": "2024-09-19T10:12:20Z",
"created": "2024-09-19T10:20:55Z",
"licenseListVersion": "3.22"
},
"name": "noto-cjk",
"dataLicense": "CC0-1.0",
"documentNamespace": "http://spdx.org/spdxdocs/noto-cjk-56b344a7-0408-433d-accc-fd5fbe6e6d60",
"documentNamespace": "http://spdx.org/spdxdocs/noto-cjk-be8b4746-e834-4c52-98dc-322be71277b5",
"files": [
{
"SPDXID": "SPDXRef-File-Serif-Variable-OTC-NotoSerifCJK-VF.otf.ttc",
Expand Down
9 changes: 8 additions & 1 deletion generate-manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def source_to_file(filename):
sbom_gen = SBOMGenerator(
sbom_type="spdx", format="json", application=__file__, version=__version__
)
sbom_gen.bom.spdx_version = "SPDX-2.2" # All ms sbom-tool can cope with

sbom = SBOM()
document = sbom_scan.get_document()
Expand Down Expand Up @@ -230,5 +231,11 @@ def relates(sbom, source, target, relationship):
relates(sbom_gen, "-", modified, "DESCRIBES")

sbom_gen.bom.showRelationship()
sbom_out = SBOMOutput("manifest.spdx.json", output_format="json")

manifest_dir = os.path.join(
"_manifest", sbom_gen.bom.spdx_version.lower().replace("-", "_")
)
os.makedirs(manifest_dir, exist_ok=True)
sbom_path = os.path.join(manifest_dir, "manifest.spdx.json")
sbom_out = SBOMOutput(sbom_path, output_format="json")
sbom_out.generate_output(sbom_gen.sbom)

0 comments on commit f8d1575

Please sign in to comment.