All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Stewart via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Christian Stewart <christian@paral.in>,
	Anisse Astier <anisse@astier.eu>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	"Yann E . MORIN" <yann.morin.1998@free.fr>
Subject: [Buildroot] [PATCH-NEXT v3 3/6] support/download/post-process-helpers: add helper function for post process scripts
Date: Sun, 10 Oct 2021 16:46:52 -0700	[thread overview]
Message-ID: <20211010234655.585526-3-christian@paral.in> (raw)
In-Reply-To: <20211010234655.585526-1-christian@paral.in>

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

download post process scripts will often need to unpack the source
code tarball, do some operation, and then repack it. In order to help
with this, post-process-helpers provide an unpack() function and a
repack() function.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Christian Stewart <christian@paral.in>
---
 support/download/post-process-helpers | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100755 support/download/post-process-helpers

diff --git a/support/download/post-process-helpers b/support/download/post-process-helpers
new file mode 100755
index 0000000000..b3231207a6
--- /dev/null
+++ b/support/download/post-process-helpers
@@ -0,0 +1,26 @@
+# Helpers for the post-process step to re-pack vendored archives.
+
+. "${0%/*}/helpers"
+
+unpack() {
+    dest="$1"
+    tarball="$2"
+
+    mkdir ${dest}
+    tar -C ${dest} --strip-components=1 -xf ${tarball}
+}
+
+repack() {
+    local in_dir="${1}"
+    local base_dir="${2}"
+    local out="${3}"
+
+    # let's use a fixed hardcoded date to be reproducible
+    date="2020-02-06 01:02:03 +0000"
+
+    # use the helper to create a reproducible archive
+    mk_tar_gz "${in_dir}/${base_dir}" "${base_dir}" "${date}" "${out}"
+}
+
+# Keep this line and the following as last lines in this file.
+# vim: ft=bash
-- 
2.33.0

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

  parent reply	other threads:[~2021-10-10 23:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Christian Stewart via buildroot [this message]
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

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=20211010234655.585526-3-christian@paral.in \
    --to=buildroot@buildroot.org \
    --cc=anisse@astier.eu \
    --cc=christian@paral.in \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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 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.