All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH-NEXT v3 1/6] support/download/dl-wrapper: add concept of download post-processing
@ 2021-10-10 23:46 Christian Stewart via buildroot
  2021-10-10 23:46 ` [Buildroot] [PATCH-NEXT v3 2/6] package/pkg-download.mk: add <pkg>_DOWNLOAD_POST_PROCESS variable Christian Stewart via buildroot
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Christian Stewart via buildroot @ 2021-10-10 23:46 UTC (permalink / raw)
  To: buildroot
  Cc: Christian Stewart, Anisse Astier, Thomas Petazzoni, Yann E . MORIN

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

In order to support package managers such as Cargo (Rust) or Go, we
want to run some custom logic after the main download, but before
packing the tarball and checking the hash.

To implement this, this commit introduces a concept of download
post-processing: if -p <something> is passed to the dl-wrapper, then
support/download/<something>-post-process will be called.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Christian Stewart <christian@paral.in>
---
 support/download/dl-wrapper | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 3315bd410e..2d74554213 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -25,7 +25,7 @@ main() {
     local -a uris
 
     # Parse our options; anything after '--' is for the backend
-    while getopts ":c:d:D:o:n:N:H:rf:u:q" OPT; do
+    while getopts ":c:d:D:o:n:N:H:rf:u:qp:" OPT; do
         case "${OPT}" in
         c)  cset="${OPTARG}";;
         d)  dl_dir="${OPTARG}";;
@@ -37,6 +37,7 @@ main() {
         r)  recurse="-r";;
         f)  filename="${OPTARG}";;
         u)  uris+=( "${OPTARG}" );;
+        p)  post_process="${OPTARG}";;
         q)  quiet="-q";;
         :)  error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
         \?) error "unknown option '%s'\n" "${OPTARG}";;
@@ -135,6 +136,12 @@ main() {
             continue
         fi
 
+        if [ -n "${post_process}" ] ; then
+                ${OLDPWD}/support/download/${post_process}-post-process \
+                         -o "${tmpf}" \
+                         -n "${raw_base_name}"
+        fi
+
         # cd back to free the temp-dir, so we can remove it later
         cd "${OLDPWD}"
 
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-01-07  0:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-10 23:46 [Buildroot] [PATCH-NEXT v3 1/6] support/download/dl-wrapper: add concept of download post-processing Christian Stewart via buildroot
2021-10-10 23:46 ` [Buildroot] [PATCH-NEXT v3 2/6] package/pkg-download.mk: add <pkg>_DOWNLOAD_POST_PROCESS variable Christian Stewart via buildroot
2021-10-10 23:46 ` [Buildroot] [PATCH-NEXT v3 3/6] support/download/post-process-helpers: add helper function for post process scripts Christian Stewart via buildroot
2021-10-10 23:46 ` [Buildroot] [PATCH-NEXT v3 4/6] support/download/go-post-process: implement Go vendoring support Christian Stewart via buildroot
2022-01-06 10:32   ` Thomas Petazzoni
2022-01-06 21:08   ` Thomas Petazzoni
2022-01-06 21:20     ` Christian Stewart via buildroot
2022-01-07  0:45       ` Christian Stewart via buildroot
2021-10-10 23:46 ` [Buildroot] [PATCH-NEXT v3 5/6] package/embiggen-disk: new package Christian Stewart via buildroot
2021-10-10 23:46 ` [Buildroot] [PATCH-NEXT v3 6/6] package/gocryptfs: " Christian Stewart via buildroot
2021-10-11  7:04 ` [Buildroot] [PATCH-NEXT v3 1/6] support/download/dl-wrapper: add concept of download post-processing Thomas Petazzoni
2021-10-11  7:13   ` Christian Stewart via buildroot
2021-10-14 21:15     ` Thomas Petazzoni
2022-01-06 21:05 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.