From 319aa2b9ed30f542124a32efbd3b27e92261b4bb Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Sun, 11 Oct 2026 11:42:14 +0200 Subject: [PATCH] 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 Signed-off-by: Thomas Perale Signed-off-by: Arnout Vandecappelle --- utils/generate-cyclonedx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/generate-cyclonedx b/utils/generate-cyclonedx index 9d3baa23f1..1fbf020a3d 100755 --- a/utils/generate-cyclonedx +++ b/utils/generate-cyclonedx @@ -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",