Make the test data source archive mostly-reproducible
This should keep us from having to upload a fresh archive to the lookaside cache for a new version when the data hasn’t actually changed.
This commit is contained in:
parent
0d84d5efd1
commit
45d8b00a4e
4 changed files with 25 additions and 7 deletions
|
|
@ -11,8 +11,13 @@ Usage: $1 VERSION
|
|||
|
||||
Generate a source archive containing the test data files for pyMapVBVD that are
|
||||
tracked in git LFS and are not included in the default source archive. The
|
||||
result will be named pyMapVBVD-\${VERSION}-test-data.tar.xz and will be written
|
||||
result will be named pyMapVBVD-test-data.tar.xz and will be written
|
||||
into the current working directory.
|
||||
|
||||
The script attempts to produce a reproducible archive to avoid uploading
|
||||
near-duplicate archives to the lookaside cache when the test data does not
|
||||
change from one version to the next. Accordingly, the top-level directory
|
||||
pyMapVBVD-\${VERSION}/ is omitted from the archived paths.
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +46,7 @@ GITDIR="$(echo "${FORGEURL}" | sed -r 's@.*/@@')"
|
|||
#SOURCE0="${FORGEURL}/archive/${VERSION}/pdfminer.six-${VERSION}.tar.gz"
|
||||
#TARNAME="$(basename "${SOURCE0}")"
|
||||
TARDIR="pyMapVBVD-${VERSION}"
|
||||
NEWTAR="${TARDIR}-test-data.tar.xz"
|
||||
NEWTAR='pyMapVBVD-test-data.tar.xz'
|
||||
|
||||
SAVEDIR="${PWD}"
|
||||
XDIR="$(mktemp -d)"
|
||||
|
|
@ -61,8 +66,20 @@ git lfs ls-files -n |
|
|||
ln "${fn}" "${DESTDIR}/$(basename "${fn}")"
|
||||
done
|
||||
|
||||
cd "${XDIR}"
|
||||
tar -cv "${TARDIR}/" | xz -9e > "${NEWTAR}"
|
||||
cd "${XDIR}/${TARDIR}"
|
||||
# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
|
||||
# We discard mtimes entirely, since git doesn’t store mtimes and they are just
|
||||
# the time we did the git clone.
|
||||
TZ=UTC LC_ALL=C tar \
|
||||
--create --verbose \
|
||||
--sort=name \
|
||||
--format=posix \
|
||||
--numeric-owner --owner=0 --group=0 \
|
||||
--mode=go+u,go-w \
|
||||
--pax-option='delete=atime,delete=ctime' \
|
||||
--clamp-mtime --mtime='@0' \
|
||||
. |
|
||||
xz -9e > "${XDIR}/${NEWTAR}"
|
||||
|
||||
cd "${SAVEDIR}"
|
||||
mv -v "${XDIR}/${NEWTAR}" .
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue