Explorar o código

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>
Yann E. MORIN %!s(int64=4) %!d(string=hai) anos
pai
achega
c043ecb20c
Modificáronse 2 ficheiros con 10 adicións e 13 borrados
  1. 1 0
      package/pkg-download.mk
  2. 9 13
      support/download/svn

+ 1 - 0
package/pkg-download.mk

@@ -20,6 +20,7 @@ export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
 # Version of the format of the archives we generate in the corresponding
 # Version of the format of the archives we generate in the corresponding
 # download backend:
 # download backend:
 BR_FMT_VERSION_git = -br1
 BR_FMT_VERSION_git = -br1
+BR_FMT_VERSION_svn = -br1
 
 
 DL_WRAPPER = support/download/dl-wrapper
 DL_WRAPPER = support/download/dl-wrapper
 
 

+ 9 - 13
support/download/svn

@@ -1,5 +1,10 @@
 #!/usr/bin/env bash
 #!/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
 # We want to catch any unexpected failure, and exit immediately
 set -e
 set -e
 
 
@@ -15,6 +20,8 @@ set -e
 # Environment:
 # Environment:
 #   SVN      : the svn command to call
 #   SVN      : the svn command to call
 
 
+. "${0%/*}/helpers"
+
 verbose=
 verbose=
 while getopts "${BR_BACKEND_DL_GETOPTS}" OPT; do
 while getopts "${BR_BACKEND_DL_GETOPTS}" OPT; do
     case "${OPT}" in
     case "${OPT}" in
@@ -45,18 +52,7 @@ _svn export ${verbose} "${@}" "'${uri}@${rev}'" "'${basename}'"
 # last line (svn outputs everything on stdout)
 # last line (svn outputs everything on stdout)
 date="$( _svn info --show-item last-changed-date "'${uri}@${rev}'" |tail -n 1 )"
 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
 # We did a 'svn export' above, so it's not a working copy (there is no .svn
 # directory or file to ignore).
 # 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}"