From 20f2fb3b1eb3db782a3f04a7f683499150fbc36a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 14 Sep 2023 02:02:22 +0200 Subject: [PATCH] MergeCommand: use Bom.BomMetadataUpdate() and BomMetadataReferThisToolkit() methods in OOP fashion Signed-off-by: Jim Klimov --- src/cyclonedx/Commands/MergeCommand.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cyclonedx/Commands/MergeCommand.cs b/src/cyclonedx/Commands/MergeCommand.cs index 7a96404..382a31e 100644 --- a/src/cyclonedx/Commands/MergeCommand.cs +++ b/src/cyclonedx/Commands/MergeCommand.cs @@ -101,8 +101,12 @@ public static async Task Merge(MergeCommandOptions options) } } - outputBom.Version = 1; - outputBom.SerialNumber = "urn:uuid:" + System.Guid.NewGuid().ToString(); + // Ensure that the new merged document has its own identity + // (new SerialNumber, Version=1, Timestamp...) and its Tools + // collection refers to this library and the program/tool + // like cyclonedx-cli which consumes it: + outputBom.BomMetadataUpdate(true); + outputBom.BomMetadataReferThisToolkit(); if (!outputToConsole) {