[Buildroot] [PATCH 7/7] package/pkg-utils: add PURL to show-info output

Thomas Perale thomas.perale at mind.be
Tue Apr 15 19:55:41 UTC 2025


This patch add a "purl" entry to packages that have an associated valid
PURL.

This patch update the `generate-cyclonedx` script as well to reflect the
change in the `show-info` output.

Signed-off-by: Thomas Perale <thomas.perale at mind.be>
---
 package/pkg-utils.mk     | 3 +++
 utils/generate-cyclonedx | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index 0266f66b42..5fdd9dcfe1 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -145,6 +145,9 @@ define _json-info-pkg
 	$(if $($(1)_CPE_ID_VALID), \
 		$(comma) "cpe-id": $(call mk-json-str,$($(1)_CPE_ID)) \
 	)
+	$(if $($(1)_PURL), \
+		$(comma) "purl": $(call mk-json-str,$($(1)_PURL)) \
+	)
 	$(if $($(1)_IGNORE_CVES),
 		$(comma) "ignore_cves": [
 			$(call make-comma-list, \
diff --git a/utils/generate-cyclonedx b/utils/generate-cyclonedx
index 46f68ac63d..f5f80c59d3 100755
--- a/utils/generate-cyclonedx
+++ b/utils/generate-cyclonedx
@@ -185,6 +185,9 @@ def cyclonedx_component(name, comp):
         **({
             "cpe": comp["cpe-id"],
         } if "cpe-id" in comp else {}),
+        **({
+            "purl": comp["purl"],
+        } if "purl" in comp else {}),
         **(cyclonedx_patches(comp["patches"]) if comp.get("patches") else {}),
         "properties": [{
             "name": "BR_TYPE",
-- 
2.49.0



More information about the buildroot mailing list