mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ralf Glaser <glaser@iotmaxx.de>
To: ptxdist@pengutronix.de
Cc: Ralf Glaser <glaser@iotmaxx.de>
Subject: [ptxdist] [PATCH] spdx_sbom.py: correct creationInfo
Date: Tue,  3 Jun 2025 16:45:01 +0200	[thread overview]
Message-ID: <20250603144728.30208-1-glaser@iotmaxx.de> (raw)

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 <glaser@iotmaxx.de>
---
 scripts/report/spdx_sbom.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/report/spdx_sbom.py b/scripts/report/spdx_sbom.py
index 124e75614..1e3a36665 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']
-- 
2.49.0




                 reply	other threads:[~2025-06-03 14:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250603144728.30208-1-glaser@iotmaxx.de \
    --to=glaser@iotmaxx.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox