diff mbox series

[scarthgap,v3,10/16] classes/create-spdx-2.2: align DEPLOY_DIR_SPDX with SPDX_VERSION layout

Message ID 20251103162654.1714239-11-kamel.bouhara@bootlin.com
State New
Headers show
Series backport: SPDX 3.0 support to Scarthgap | expand

Commit Message

Kamel Bouhara Nov. 3, 2025, 4:26 p.m. UTC
From: "Kamel Bouhara (Schneider Electric)" <kamel.bouhara@bootlin.com>

Upstream commit 544d46e4169a ("selftest/spdx: Fix for SPDX_VERSION addition")
updated the selftests to expect SPDX artifacts under:

    ${DEPLOY_DIR}/spdx/${SPDX_VERSION}/

However, in this branch the effective SPDX output was still being
written to:

    ${DEPLOY_DIR}/spdx/${PACKAGE_ARCH}/

without the version subdirectory. This caused SPDX selftests such as
test_spdx_tar to fail with missing file errors, e.g.:

    AssertionError: .../deploy/spdx/SPDX-1.1/core2-64/packages/tar.spdx.json does not exist

Update create-spdx-2.2.bbclass so that DEPLOY_DIR_SPDX includes
${SPDX_VERSION}, matching the expected deploy structure and restoring
successful SPDX selftests.

Signed-off-by: Kamel Bouhara (Schneider Electric) <kamel.bouhara@bootlin.com>
---
 meta/classes/create-spdx-2.2.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass
index 1fc11ad7ac..f5adcc548d 100644
--- a/meta/classes/create-spdx-2.2.bbclass
+++ b/meta/classes/create-spdx-2.2.bbclass
@@ -4,7 +4,8 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
 #
 
-DEPLOY_DIR_SPDX ??= "${DEPLOY_DIR}/spdx"
+SPDX_VERSION = "2.2"
+DEPLOY_DIR_SPDX ??= "${DEPLOY_DIR}/spdx/${SPDX_VERSION}"
 
 # The product name that the CVE database uses.  Defaults to BPN, but may need to
 # be overriden per recipe (for example tiff.bb sets CVE_PRODUCT=libtiff).