package/pkg-utils.mk: expose CPE ID in show-info when available
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 4 Nov 2020 14:51:39 +0000 (15:51 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 26 Nov 2020 15:36:35 +0000 (16:36 +0100)
This commit exposes a new per-package property in the "make show-info"
JSON output: "cpe-id", which exists when a valid CPE ID is available
for the package.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com>
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/pkg-utils.mk

index 4fcb076e21d0594e1ad651f5ea0e7ed37f45c3d1..a2cc160d0b7fb3260ede76963f44f75c1abb8c5b 100644 (file)
@@ -119,6 +119,9 @@ define _json-info-pkg
        "reverse_dependencies": [
                $(call make-comma-list,$(sort $($(1)_RDEPENDENCIES)))
        ]
+       $(if $($(1)_CPE_ID_VALID), \
+               $(comma) "cpe-id": "$($(1)_CPE_ID)" \
+       )
        $(if $($(1)_IGNORE_CVES),
                $(comma) "ignore_cves": [
                        $(call make-comma-list,$(sort $($(1)_IGNORE_CVES)))