mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl via ptxdist <ptxdist@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <ada@thorsis.com>, Ralf Glaser <glaser@iotmaxx.de>,
	Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [ptxdist] [PATCH 3/3] report: spdx_sbom: Convert pkg_name into valid idstring
Date: Mon, 14 Sep 2026 13:23:11 +0200	[thread overview]
Message-ID: <20260914112311.93693-4-ada@thorsis.com> (raw)
In-Reply-To: <20260914112311.93693-1-ada@thorsis.com>

For referenced elements the SPDX spec does not allow '_' in names, but
we have packages like for example 'lm_sensors'.

Link: https://spdx.github.io/spdx-spec/v2.3/package-information/#72-package-spdx-identifier-field
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 scripts/report/spdx_sbom.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/report/spdx_sbom.py b/scripts/report/spdx_sbom.py
index 7c4f1c6bb..252828bc5 100644
--- a/scripts/report/spdx_sbom.py
+++ b/scripts/report/spdx_sbom.py
@@ -50,7 +50,7 @@ class SpdxSbomGenerator(SbomGenerator):
 
         spdx_pkg = spdx.SPDXPackage()
         spdx_pkg.name = pkg_name
-        spdx_pkg.SPDXID = "SPDXRef-" + pkg_name
+        spdx_pkg.SPDXID = "SPDXRef-" + pkg_name.replace('_', '-')
         if "version" in pkg:
             spdx_pkg.versionInfo = pkg["version"]
         if "url" in pkg:
-- 
2.47.3




      parent reply	other threads:[~2026-09-14 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 11:23 [ptxdist] [PATCH 0/3] report: spdx_sbom: Assorted minor improvements Alexander Dahl via ptxdist
2026-09-14 11:23 ` [ptxdist] [PATCH 1/3] report: spdx_sbom: Fixed "created" field format Alexander Dahl via ptxdist
2026-09-14 11:23 ` [ptxdist] [PATCH 2/3] report: spdx_sbom: Fix externalPackageRef type in category SECURITY Alexander Dahl via ptxdist
2026-09-14 11:23 ` Alexander Dahl via ptxdist [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=20260914112311.93693-4-ada@thorsis.com \
    --to=ptxdist@pengutronix.de \
    --cc=ada@thorsis.com \
    --cc=glaser@iotmaxx.de \
    --cc=m.olbrich@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