package/pkg-utils: add install_{staging, target, images} details in show-info
authorVadim Kochan <vadim4j@gmail.com>
Tue, 6 Aug 2019 11:02:03 +0000 (14:02 +0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 6 Aug 2019 20:28:32 +0000 (22:28 +0200)
This commit extends the show-info/<pkg>-show-info logic to include in
the JSON output details about whether the package installs files to
target, staging and/or images.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/pkg-utils.mk

index b7280e930f8f9c2276da724a4d63c0c2f0bbc58e..74ade437d993fa4b68a51f303d5cdd2414207cf2 100644 (file)
@@ -62,6 +62,11 @@ $$(error Package error: use $(2) instead of $(1). Please fix your .mk file)
 endif
 endef
 
+# $(1): YES or NO
+define yesno-to-bool
+       $(subst NO,false,$(subst YES,true,$(1)))
+endef
+
 # json-info -- return package or filesystem metadata formatted as an entry
 #              of a JSON dictionnary
 # $(1): upper-case package or filesystem name
@@ -94,6 +99,9 @@ endef
 define _json-info-pkg-details
        "version": "$($(1)_DL_VERSION)",
        "licenses": "$($(1)_LICENSE)",
+       "install_target": $(call yesno-to-bool,$($(1)_INSTALL_TARGET)),
+       "install_staging": $(call yesno-to-bool,$($(1)_INSTALL_STAGING)),
+       "install_images": $(call yesno-to-bool,$($(1)_INSTALL_IMAGES)),
        "downloads": [
        $(foreach dl,$(sort $($(1)_ALL_DOWNLOADS)),
                {