Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/pkg-utils.mk: add dl_dir to show-info output
Date: Wed, 19 Jun 2019 22:17:32 +0200	[thread overview]
Message-ID: <20190619201732.24027-1-arnout@mind.be> (raw)

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 downloads list of a package. It
can be used with the following jq script to get a newline-separated list
of all downloaded files:

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

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/pkg-utils.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index b7280e930f..4de0bc042c 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -104,7 +104,8 @@ define _json-info-pkg-details
 						$(call DOWNLOAD_URIS,$(dl),$(1))
 					)
 				)
-			]
+			],
+			"dl_dir": "$($(1)_DL_DIR)"
 		},
 	)
 	],
-- 
2.21.0

             reply	other threads:[~2019-06-19 20:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 20:17 Arnout Vandecappelle [this message]
2019-06-19 20:28 ` [Buildroot] [PATCH] package/pkg-utils.mk: add dl_dir to show-info output Yann E. MORIN
2019-06-22  8:05   ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2019-08-03 13:49 Arnout Vandecappelle
2019-09-22 11:54 ` Yann E. MORIN
2019-09-22 11:55   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619201732.24027-1-arnout@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox