utils/generate-cyclonedx: support custom schema version

Support using minor revision for CycloneDX 1.6 by passing the version
from the command line. Currently supported:

- 1.6
- 1.6.1 [1]
- 1.6.2 (default) [2]

This is used to fetch the latest SPDX license list available upstream.

[1] https://github.com/CycloneDX/specification/releases/tag/1.6.1
[2] https://github.com/CycloneDX/specification/releases/tag/1.6.2

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
[Arnout: also rename the SPDX schema in the test]
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Thomas Perale
2026-06-24 12:13:37 +02:00
committed by Arnout Vandecappelle
parent 4ba8e2869b
commit 504bb61bc6
2 changed files with 9 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ class TestGenerateCycloneDX(unittest.TestCase):
cyclonedx_dir = Path(self.schema_dir.name) / "cyclonedx"
cyclonedx_dir.mkdir(parents=True)
schema_path = cyclonedx_dir / "spdx-1.6.schema.json"
schema_path = cyclonedx_dir / "spdx-1.6.2.schema.json"
schema_path.write_text(json.dumps({"enum": SCHEMA_LICENSES}))
self.env = os.environ.copy()