From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 30 Jun 2025 18:15:09 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uWH9x-00Cfgt-2F for lore@lore.pengutronix.de; Mon, 30 Jun 2025 18:15:09 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1uWH9x-0003AE-DY; Mon, 30 Jun 2025 18:15:09 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1uWH9V-0002LA-Ju; Mon, 30 Jun 2025 18:14:41 +0200 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uWH9V-0068GM-1N; Mon, 30 Jun 2025 18:14:41 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1uWH9V-00FkVr-1E; Mon, 30 Jun 2025 18:14:41 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Mon, 30 Jun 2025 18:14:41 +0200 Message-Id: <20250630161441.3753708-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250603144728.30208-1-glaser@iotmaxx.de> References: <20250603144728.30208-1-glaser@iotmaxx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] spdx_sbom.py: correct creationInfo X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Ralf Glaser Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as 6c38ae66ad0c29ca95841f912c1d851e941d396d. Michael [sent from post-receive hook] On Mon, 30 Jun 2025 18:14:41 +0200, Ralf Glaser wrote: > Use a timezone aware datetime object and correct "creators" information > as otherwise https://tools.spdx.org/app/validate/ will not recognize > the SPDX-SBOM as valid. > > Signed-off-by: Ralf Glaser > Message-Id: <20250603144728.30208-1-glaser@iotmaxx.de> > Signed-off-by: Michael Olbrich > > diff --git a/scripts/report/spdx_sbom.py b/scripts/report/spdx_sbom.py > index 124e756142d0..1e3a366659d6 100644 > --- a/scripts/report/spdx_sbom.py > +++ b/scripts/report/spdx_sbom.py > @@ -6,7 +6,7 @@ > # see the README file. > # > > -from datetime import datetime > +from datetime import datetime, timezone > from os import path > from shutil import copy > import hashlib > @@ -142,8 +142,8 @@ class SpdxSbomGenerator(SbomGenerator): > > def build(self, data): > creationInfo = spdx.SPDXCreationInfo() > - creationInfo.created = datetime.now().isoformat() > - creationInfo.creators = [data['bsp']['vendor']] > + creationInfo.created = datetime.now(timezone.utc).replace(microsecond=0).isoformat() > + creationInfo.creators = [ f"Organization: {data['bsp']['vendor']}", f"Tool: ptxdist-{data['ptxdist']['version']}" ] > document = spdx.SPDXDocument() > document.creationInfo = creationInfo > document.name = data['bsp']['project']