package/pkg-utils.mk: introduce "name" field in show-info output
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 31 Jan 2021 13:38:13 +0000 (14:38 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sun, 31 Jan 2021 21:12:54 +0000 (22:12 +0100)
The keys of the JSON dict returned by "make show-info" is the package
name, including the "host-" prefix for host packages.

However, it is sometimes useful to get the actual name of the package,
without the "host-" prefix, so we add a "name" property that holds the
"raw name" of the package.

Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/pkg-utils.mk

index 11090cb62837c906000d8b2230257095d3b27d55..d94041de247afab6a6e4c0cd0c149d0aa91bbbc4 100644 (file)
@@ -96,6 +96,7 @@ endef
 # $(1): upper-case package or filesystem name
 define json-info
        "$($(1)_NAME)": {
+               "name": "$($(1)_RAWNAME)",
                "type": "$($(1)_TYPE)",
                $(if $(filter rootfs,$($(1)_TYPE)), \
                        $(call _json-info-fs,$(1)), \