utils/generate-cyclonedx: add comment to explain spec_version

The commit [1] introduced the `cdx_spec_version` variable.
The reason for that variable is not immediately clear. Only the license
schema can use patch revision while the spec version should always
exclude the patch revision.

This commit adds a comment clarifying this.

[1] 504bb61bc6 utils/generate-cyclonedx: support custom schema version

Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Thomas Perale
2026-10-11 11:42:14 +02:00
committed by Arnout Vandecappelle
parent c13eabf18f
commit 319aa2b9ed

View File

@@ -562,6 +562,10 @@ def main():
filtered_show_info_dict = {k: v for k, v in show_info_dict.items()
if ("rootfs" not in v["type"]) and (args.virtual or v["virtual"] is False)}
# Only keep the first two numbers of the 'cdx-version' argument.
# While the patch revision (e.g. 1.6.2) can be used for the license list,
# only the first two numbers (e.g. 1.6) are valid in the schema and the
# 'specVersion'.
cdx_spec_version = ".".join(args.cdx_version.split(".")[:2])
cyclonedx_dict = {
"bomFormat": "CycloneDX",