Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3] package/pkg-utils.mk: add dl_dir to show-info output
@ 2019-08-03 14:04 Arnout Vandecappelle
  2019-08-03 14:14 ` Yann E. MORIN
  2019-09-25 20:02 ` Thomas Petazzoni
  0 siblings, 2 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2019-08-03 14:04 UTC (permalink / raw)
  To: buildroot

It can be useful for scripts to be able to access a package's source
file after download. That used to be easy, just DL_DIR/PKG_SOURCE.
However, with the subdirectories in DL_DIR which can be overridden with
PKG_DL_SUBDIR, that is no longer easy.

Therefore, this patch adds dl_dir to the package information. It prints
just PKG_DL_SUBDIR, to avoid dumping absolute paths to the buildroot
directory in the show-info output.

It can be used with the following jq script to get a newline-separated
list of all downloaded files:

make show-info | jq -r '.[] | ("dl/" + .dl_dir + "/" + .downloads[]?.source)'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
---
v2 -> v3:
 - Remove accidental change

v1 -> v2:
 - Use DL_SUBDIR (i.e. relative path) instead of DL_DIR (i.e. absolute
   path). (Yann)
 - Move the definition one level higher, because it is anyway the same
   for all sources. (Yann)
 - Update jq script in commit message to handle the above.
---
 package/pkg-utils.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index b7280e930f..ef93345595 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -94,6 +94,7 @@ endef
 define _json-info-pkg-details
 	"version": "$($(1)_DL_VERSION)",
 	"licenses": "$($(1)_LICENSE)",
+	"dl_dir": "$($(1)_DL_SUBDIR)",
 	"downloads": [
 	$(foreach dl,$(sort $($(1)_ALL_DOWNLOADS)),
 		{
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-09-26  8:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-03 14:04 [Buildroot] [PATCH v3] package/pkg-utils.mk: add dl_dir to show-info output Arnout Vandecappelle
2019-08-03 14:14 ` Yann E. MORIN
2019-09-25 20:02 ` Thomas Petazzoni
2019-09-25 20:41   ` Yann E. MORIN
2019-09-25 21:28     ` Arnout Vandecappelle
2019-09-26  6:55       ` Thomas Petazzoni
2019-09-26  8:58         ` yann.morin at orange.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox