spdx30_tasks: Exclude 'doc' when exporting PACKAGECONFIG to SPDX

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.

(From OE-Core rev: 87de87206b71bb165b946d5f4f6e9e5395292179)

Signed-off-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 933394adcb0d2db66ef7e0656a464241e58ec2e7)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Benjamin Robin (Schneider Electric)
2026-02-09 17:25:52 +01:00
committed by Richard Purdie
parent 5e5234a7de
commit c4da6ca1c2

View File

@@ -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"