package/pkg-utils: add 'hashes' to show-info

Finding the hash file for a package is non-trivial, as they can be in a
<version> sub-directory or under GLOBAL_PATCH_DIR. To allow other tools
such as utils/generate-cyclonedx to find hash files, expose this information
from show-info. If a package does not provide a hash file, create an
empty hashes array.

Suggested-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Martin Willi <martin@strongswan.org>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Martin Willi
2026-04-09 10:13:59 +02:00
committed by Arnout Vandecappelle
parent e4f0fb126d
commit 619d44b23a

View File

@@ -197,6 +197,13 @@ define _json-info-pkg-details
},
)
],
"hashes": [
$(call make-comma-list, \
$(foreach hash,$(wildcard $($(1)_HASH_FILES)),
$(call mk-json-str,$(hash)) \
) \
)
],
"patches": [
$(foreach patch, \
$(call pkg-patches-list,$(1)), \