From: Heiko Thiery <heiko.thiery@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/download/svn: generate reproducible svn archives
Date: Sun, 22 Dec 2019 22:31:49 +0100 [thread overview]
Message-ID: <20191222213148.13762-1-heiko.thiery@gmail.com> (raw)
To generate a reproducible archive from a svn repository mainly the same
aproach is done like for the archives from a git repository.
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
support/download/svn | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/support/download/svn b/support/download/svn
index 542b25c0a2..505cdd58b1 100755
--- a/support/download/svn
+++ b/support/download/svn
@@ -38,4 +38,19 @@ _svn() {
_svn export ${verbose} "${@}" "'${uri}@${rev}'" "'${basename}'"
-tar czf "${output}" "${basename}"
+# Generate the archive, sort with the C locale so that it is reproducible.
+# We do not want the .svn dir; we keep other .svn files, in case they are the
+# only files in their directory.
+find "${basename}" -not -type d \
+ -and -not -path "./.svn/*" >"${output}.list"
+LC_ALL=C sort <"${output}.list" >"${output}.list.sorted"
+
+# Create GNU-format tarballs, since that's the format of the tarballs on
+# sources.buildroot.org and used in the *.hash files
+tar cf - --transform="s#^\./#${basename}/#" \
+ --numeric-owner --owner=0 --group=0 --mtime="${date}" --format=gnu \
+ -T "${output}.list.sorted" >"${output}.tar"
+gzip -6 -n <"${output}.tar" >"${output}"
+
+rm -f "${output}.list"
+rm -f "${output}.list.sorted"
--
2.20.1
next reply other threads:[~2019-12-22 21:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-22 21:31 Heiko Thiery [this message]
2019-12-22 21:36 ` [Buildroot] [PATCH] support/download/svn: generate reproducible svn archives Thomas Petazzoni
2019-12-22 21:40 ` Heiko Thiery
2019-12-22 21:54 ` Heiko Thiery
2019-12-22 21:57 ` Thomas Petazzoni
2019-12-23 17:16 ` Yann E. MORIN
2019-12-23 22:05 ` Peter Korsgaard
2019-12-23 22:19 ` Thomas Petazzoni
2019-12-23 22:36 ` Peter Korsgaard
2020-01-06 9:31 ` Alexandre Belloni
2019-12-30 9:58 ` Yann E. MORIN
2020-05-22 14:09 ` 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=20191222213148.13762-1-heiko.thiery@gmail.com \
--to=heiko.thiery@gmail.com \
--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