diff mbox series

[RFC] spdx: Add ability to change the deploy SBoM name

Message ID 20260610142658.10318-1-leoreis.costa@gmail.com
State New
Headers show
Series [RFC] spdx: Add ability to change the deploy SBoM name | expand

Commit Message

Leonardo Costa June 10, 2026, 2:26 p.m. UTC
From: Leonardo Costa <leonardo.costa@toradex.com>

Allow "deploy" tasks that have set SPDX_DEPLOY_TASKS to choose a custom
name for their deploy SBoM.

Signed-off-by: Leonardo Costa <leonardo.costa@toradex.com>
---
 meta/classes/create-spdx-3.0.bbclass | 4 ++++
 meta/lib/oe/spdx30_tasks.py          | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Joshua Watt June 10, 2026, 9:59 p.m. UTC | #1
On Wed, Jun 10, 2026 at 8:27 AM Leonardo Costa <leoreis.costa@gmail.com> wrote:
>
> From: Leonardo Costa <leonardo.costa@toradex.com>
>
> Allow "deploy" tasks that have set SPDX_DEPLOY_TASKS to choose a custom
> name for their deploy SBoM.

LGTM. I will pull this onto my local branch since it depends on my
changes; would you be OK if I squashed it into my change that adds the
task, or would you prefer it be a separate commit?

>
> Signed-off-by: Leonardo Costa <leonardo.costa@toradex.com>
> ---
>  meta/classes/create-spdx-3.0.bbclass | 4 ++++
>  meta/lib/oe/spdx30_tasks.py          | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/create-spdx-3.0.bbclass b/meta/classes/create-spdx-3.0.bbclass
> index f915f5cfd5..1444816530 100644
> --- a/meta/classes/create-spdx-3.0.bbclass
> +++ b/meta/classes/create-spdx-3.0.bbclass
> @@ -178,6 +178,10 @@ SPDX_DEPLOY_TASKS[doc] = "A space separated list of sstate tasks that produce \
>      'after do_create_spdx'.\
>      "
>
> +SPDX_DEPLOY_SBOM_NAME ?= "${PN}-deploy-sbom"
> +SPDX_DEPLOY_SBOM_NAME[doc] = "The name of the output deploy SBoM when using \
> +    create_deploy_sbom"
> +
>  SPDX_DEPLOY_ARTIFACTS = "AUTO"
>  SPDX_DEPLOY_ARITFACTS[doc] = "A space separated list of deployed artifacts, \
>      relative to SPDX_DEPLOY_ARTIFACTS_DIR that should be included in the SBoM. \
> diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
> index b69f79eae9..d56cbe543e 100644
> --- a/meta/lib/oe/spdx30_tasks.py
> +++ b/meta/lib/oe/spdx30_tasks.py
> @@ -1885,7 +1885,7 @@ def create_deploy_spdx(d, spdxdeploydir, artifactsdir, artifacts):
>
>  def create_deploy_sbom(d, deploydir, deploy_tasks):
>      pn = d.getVar("PN")
> -    sbom_name = f"{pn}-deploy-sbom"
> +    sbom_name = d.getVar("SPDX_DEPLOY_SBOM_NAME")
>
>      objsets = []
>      for t in deploy_tasks:
diff mbox series

Patch

diff --git a/meta/classes/create-spdx-3.0.bbclass b/meta/classes/create-spdx-3.0.bbclass
index f915f5cfd5..1444816530 100644
--- a/meta/classes/create-spdx-3.0.bbclass
+++ b/meta/classes/create-spdx-3.0.bbclass
@@ -178,6 +178,10 @@  SPDX_DEPLOY_TASKS[doc] = "A space separated list of sstate tasks that produce \
     'after do_create_spdx'.\
     "
 
+SPDX_DEPLOY_SBOM_NAME ?= "${PN}-deploy-sbom"
+SPDX_DEPLOY_SBOM_NAME[doc] = "The name of the output deploy SBoM when using \
+    create_deploy_sbom"
+
 SPDX_DEPLOY_ARTIFACTS = "AUTO"
 SPDX_DEPLOY_ARITFACTS[doc] = "A space separated list of deployed artifacts, \
     relative to SPDX_DEPLOY_ARTIFACTS_DIR that should be included in the SBoM. \
diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
index b69f79eae9..d56cbe543e 100644
--- a/meta/lib/oe/spdx30_tasks.py
+++ b/meta/lib/oe/spdx30_tasks.py
@@ -1885,7 +1885,7 @@  def create_deploy_spdx(d, spdxdeploydir, artifactsdir, artifacts):
 
 def create_deploy_sbom(d, deploydir, deploy_tasks):
     pn = d.getVar("PN")
-    sbom_name = f"{pn}-deploy-sbom"
+    sbom_name = d.getVar("SPDX_DEPLOY_SBOM_NAME")
 
     objsets = []
     for t in deploy_tasks: