All of lore.kernel.org
 help / color / mirror / Atom feed
From: iwanicki92 <iwanicki92@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2] classes: spdx-3.0: add missing vardeps
Date: Sat, 22 Aug 2026 22:56:13 +0200	[thread overview]
Message-ID: <20260822205612.3522119-2-iwanicki92@gmail.com> (raw)

Add "${SPDX_IMAGE_SUPPLIER}_name", "${SPDX_IMAGE_SUPPLIER}_type",
"${SPDX_PACKAGE_SUPPLIER}_name", and "${SPDX_PACKAGE_SUPPLIER}_type" to
respective task vardeps to make sure SPDX is regenerated if those
change.

Tested by building minimal image with:

```
SPDX_PACKAGE_SUPPLIER = "SPDX_PACKAGE_SUPPLIER"
SPDX_PACKAGE_SUPPLIER_name = "AAAA"
SPDX_PACKAGE_SUPPLIER_type = "organization"
```

then rebuilding with `SPDX_PACKAGE_SUPPLIER_name = "BBBB"` and checking
if every instance of AAAA was changed to BBBB in resulting image SBOM.
Same with SPDX_IMAGE_SUPPLIER.

Previous patch only added SPDX_PACKAGE_SUPPLIER to
do_create_package_spdx but this resulted in most of supplier names not
being changed.

Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
---
 meta/classes-recipe/create-spdx-image-3.0.bbclass |  4 +++-
 meta/classes/create-spdx-3.0.bbclass              | 13 ++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/meta/classes-recipe/create-spdx-image-3.0.bbclass b/meta/classes-recipe/create-spdx-image-3.0.bbclass
index cf79ef5b013a..faf4eef8a9a3 100644
--- a/meta/classes-recipe/create-spdx-image-3.0.bbclass
+++ b/meta/classes-recipe/create-spdx-image-3.0.bbclass
@@ -57,7 +57,9 @@ do_create_image_spdx[dirs] = "${SPDXIMAGEWORK}"
 do_create_image_spdx[file-checksums] += "${SPDX3_DEP_FILES}"
 do_create_image_spdx[vardeps] += "\
     SPDX_IMAGE_PURPOSE \
-    "
+    ${@'${SPDX_IMAGE_SUPPLIER}_name' if d.getVar('SPDX_IMAGE_SUPPLIER') else ''} \
+    ${@'${SPDX_IMAGE_SUPPLIER}_type' if d.getVar('SPDX_IMAGE_SUPPLIER') else ''} \
+"
 
 python do_create_image_spdx_setscene() {
     sstate_setscene(d)
diff --git a/meta/classes/create-spdx-3.0.bbclass b/meta/classes/create-spdx-3.0.bbclass
index 56fd01fd533b..35707fddbbb3 100644
--- a/meta/classes/create-spdx-3.0.bbclass
+++ b/meta/classes/create-spdx-3.0.bbclass
@@ -231,7 +231,11 @@ do_create_spdx[depends] += " \
     ${PATCHDEPENDENCY} \
     ${@create_spdx_source_deps(d)} \
 "
-do_create_spdx[vardeps] += "${SPDX3_VAR_DEPS}"
+do_create_spdx[vardeps] += " \
+    ${SPDX3_VAR_DEPS} \
+    ${@'${SPDX_PACKAGE_SUPPLIER}_name' if d.getVar('SPDX_PACKAGE_SUPPLIER') else ''} \
+    ${@'${SPDX_PACKAGE_SUPPLIER}_type' if d.getVar('SPDX_PACKAGE_SUPPLIER') else ''} \
+"
 
 python do_create_spdx_setscene () {
     sstate_setscene(d)
@@ -253,7 +257,11 @@ do_create_package_spdx[dirs] = "${SPDXRUNTIMEDEPLOY}"
 do_create_package_spdx[cleandirs] = "${SPDXRUNTIMEDEPLOY}"
 do_create_package_spdx[deptask] = "do_create_spdx"
 do_create_package_spdx[rdeptask] = "do_create_spdx"
-do_create_package_spdx[vardeps] += "${SPDX3_VAR_DEPS}"
+do_create_package_spdx[vardeps] += " \
+    ${SPDX3_VAR_DEPS} \
+    ${@'${SPDX_PACKAGE_SUPPLIER}_name' if d.getVar('SPDX_PACKAGE_SUPPLIER') else ''} \
+    ${@'${SPDX_PACKAGE_SUPPLIER}_type' if d.getVar('SPDX_PACKAGE_SUPPLIER') else ''} \
+"
 
 python do_create_package_spdx_setscene () {
     sstate_setscene(d)
@@ -290,4 +298,3 @@ python spdx30_build_started_handler () {
 
 addhandler spdx30_build_started_handler
 spdx30_build_started_handler[eventmask] = "bb.event.BuildStarted"
-
-- 
2.55.0



                 reply	other threads:[~2026-08-22 20:56 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=20260822205612.3522119-2-iwanicki92@gmail.com \
    --to=iwanicki92@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.