diff mbox series

[scarthgap] spdx30_tasks: Exclude 'doc' when exporting PACKAGECONFIG to SPDX

Message ID 20260213-backport-fix-packageconfig-spdx-v1-1-b157f0f0698b@bootlin.com
State New
Delegated to: Yoann Congal
Headers show
Series [scarthgap] spdx30_tasks: Exclude 'doc' when exporting PACKAGECONFIG to SPDX | expand

Commit Message

Benjamin Robin (Schneider Electric) Feb. 13, 2026, 10 a.m. UTC
Currently when generating an SBOM, all packages have the 'doc' feature
indicated as disabled. This is in fact *not* a feature that was
declared in the recipe, but instead the documentation of the
PACKAGECONFIG variable.

But to be safe, if somehow a feature is named 'doc' and enabled, do
not exclude it when exporting PACKAGECONFIG features to SPDX.

(cherry picked from commit 933394adcb0d2db66ef7e0656a464241e58ec2e7)

Signed-off-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
---
 meta/lib/oe/spdx30_tasks.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


---
base-commit: d50e4680ed6f930582d907b37c9ed545a89f5c27
change-id: 20260213-backport-fix-packageconfig-spdx-6dfda9c0a69b

Best regards,
diff mbox series

Patch

diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
index a3d848ceb1fe..a8970dcca0f7 100644
--- a/meta/lib/oe/spdx30_tasks.py
+++ b/meta/lib/oe/spdx30_tasks.py
@@ -811,12 +811,14 @@  def create_spdx(d):
 
     if d.getVar("SPDX_INCLUDE_PACKAGECONFIG", True) != "0":
         packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
-        all_features = (d.getVarFlags("PACKAGECONFIG") or {}).keys()
+        all_features = set((d.getVarFlags("PACKAGECONFIG") or {}).keys())
+        blacklisted_features = {"doc"}
 
         if all_features:
             enabled = set(packageconfig)
-            all_features_set = set(all_features)
-            disabled = all_features_set - enabled
+            disabled = all_features - enabled
+            all_features -= disabled & blacklisted_features
+            disabled -= blacklisted_features
 
             for feature in sorted(all_features):
                 status = "enabled" if feature in enabled else "disabled"