aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2020-12-28 12:06:11 +0100
committerGravatar Yann E. MORIN <yann.morin.1998@free.fr>2021-01-10 22:06:58 +0100
commitc043ecb20ce6ac316fe31da6d2db5b13a34dc414 (patch)
tree64deb88bb2ec3f86a35fab259560208a45e7b356 /support
parentccfae1701511cac1322c9b796a423ac68b85fc64 (diff)
downloadbuildroot-c043ecb20ce6ac316fe31da6d2db5b13a34dc414.tar.gz
buildroot-c043ecb20ce6ac316fe31da6d2db5b13a34dc414.tar.bz2
support/download: change format of archives generated from svn
Like we recently did for git, switch the archives generated from subversion to be reproducible whatever the tar version. We have no in-tree users of the svn backend which also has hashes, so no hash to update. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Heiko Thiery <heiko.thiery@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Vincent Fazio <vfazio@xes-inc.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Diffstat (limited to 'support')
-rwxr-xr-xsupport/download/svn22
1 files changed, 9 insertions, 13 deletions
diff --git a/support/download/svn b/support/download/svn
index b7a6ac7443..839dccaf62 100755
--- a/support/download/svn
+++ b/support/download/svn
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
+# NOTE: if the output of this backend has to change (e.g. we change what gets
+# included in the archive, or we change the format of the archive (e.g. tar
+# options, compression ratio or method)), we MUST update the format version
+# in the variable BR_FTM_VERSION_svn, in package/pkg-download.mk.
+
# We want to catch any unexpected failure, and exit immediately
set -e
@@ -15,6 +20,8 @@ set -e
# Environment:
# SVN : the svn command to call
+. "${0%/*}/helpers"
+
verbose=
while getopts "${BR_BACKEND_DL_GETOPTS}" OPT; do
case "${OPT}" in
@@ -45,18 +52,7 @@ _svn export ${verbose} "${@}" "'${uri}@${rev}'" "'${basename}'"
# last line (svn outputs everything on stdout)
date="$( _svn info --show-item last-changed-date "'${uri}@${rev}'" |tail -n 1 )"
-# Generate the archive, sort with the C locale so that it is reproducible.
+# Generate the archive.
# We did a 'svn export' above, so it's not a working copy (there is no .svn
# directory or file to ignore).
-find "${basename}" -not -type d >"${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"
+mk_tar_gz "${basename}" "${basename}" "${date}" "${output}"