mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Ralf Glaser <glaser@iotmaxx.de>
Subject: Re: [ptxdist] [APPLIED] spdx_sbom.py: correct creationInfo
Date: Mon, 30 Jun 2025 18:14:41 +0200	[thread overview]
Message-ID: <20250630161441.3753708-1-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20250603144728.30208-1-glaser@iotmaxx.de>

Thanks, applied as 6c38ae66ad0c29ca95841f912c1d851e941d396d.

Michael

[sent from post-receive hook]

On Mon, 30 Jun 2025 18:14:41 +0200, Ralf Glaser <glaser@iotmaxx.de> 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 <glaser@iotmaxx.de>
> Message-Id: <20250603144728.30208-1-glaser@iotmaxx.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> 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']



      reply	other threads:[~2025-06-30 16:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 14:45 [ptxdist] [PATCH] " Ralf Glaser
2025-06-30 16:14 ` Michael Olbrich [this message]

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=20250630161441.3753708-1-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=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