File tree Expand file tree Collapse file tree 2 files changed +39
-11
lines changed
Expand file tree Collapse file tree 2 files changed +39
-11
lines changed Original file line number Diff line number Diff line change 77if test -d /home/kitware/Packaging; then
88 cd /home/kitware/Packaging
99fi
10- zstd_exe=zstd
11- if test -e /home/kitware/Support/zstd-build/programs/zstd; then
10+
11+ # -----------------------------------------------------------------------
12+
13+ zstd_exe=` (which zstd)`
14+ if [[ -z ${zstd_exe} && -e /home/kitware/Support/zstd-build/programs/zstd ]]; then
1215 zstd_exe=/home/kitware/Support/zstd-build/programs/zstd
1316fi
17+
18+ # Find an appropriately versioned zstd.
19+ #
20+ # "--long" is introduced in zstd==v1.3.2
21+ # https://github.com/facebook/zstd/releases/tag/v1.3.2
22+ #
23+ # Sample --version output:
24+ # *** zstd command line interface 64-bits v1.4.4, by Yann Collet *** #
25+ ZSTD_MIN_VERSION=" 1.3.2"
26+
27+ if [[ -n ` (which dpkg)` && ` (${zstd_exe} --version)` =~ v([0-9]+.[0-9]+.[0-9]+) ]]; then
28+ if $( dpkg --compare-versions ${BASH_REMATCH[1]} " ge" ${ZSTD_MIN_VERSION} ) ; then
29+ echo " Found zstd v${BASH_REMATCH[1]} at ${zstd_exe} "
30+ else
31+ echo " Expected zstd v${ZSTD_MIN_VERSION} or higher but found v${BASH_REMATCH[1]} at ${zstd_exe} "
32+ exit 255
33+ fi
34+ else
35+ # dpkg not available for version comparison so simply print version
36+ ${zstd_exe} --version
37+ fi
38+
39+ # -----------------------------------------------------------------------
40+
1441tar -c --to-stdout \
1542 ITKPythonPackage/ITK-* \
1643 ITKPythonPackage/oneTBB* \
1744 ITKPythonPackage/scripts > ITKPythonBuilds-linux.tar
1845$zstd_exe -f \
1946 -10 \
2047 -T6 \
48+ --long=31 \
2149 ./ITKPythonBuilds-linux.tar \
2250 -o ./ITKPythonBuilds-linux.tar.zst
Original file line number Diff line number Diff line change 3535done
3636# -----------------------------------------------------------------------
3737
38- # Packages distributed by github are in zstd format, so we need to download that binary to uncompress
39- if [[ ! -f zstd-1.2.0-linux.tar.gz ]]; then
40- curl https://data.kitware.com/api/v1/file/592dd8068d777f16d01e1a92/download -o zstd-1.2.0-linux.tar.gz
41- gunzip -d zstd-1.2.0-linux.tar.gz
42- tar xf zstd-1.2.0-linux.tar
43- fi
44- if [[ ! -f ./zstd-1.2.0-linux/bin/unzstd ]]; then
45- echo " ERROR: can not find required binary './zstd-1.2.0-linux/bin/unzstd'"
38+ # Verifies that unzstd binary is available to decompress ITK build archives.
39+ unzstd_exe=` (which unzstd)`
40+
41+ if [[ -z ${unzstd_exe} ]]; then
42+ echo " ERROR: can not find required binary 'unzstd' "
4643 exit 255
4744fi
4845
46+ # Expect unzstd > v1.3.2, see discussion in `dockcross-manylinux-build-tarball.sh`
47+ ${unzstd_exe} --version
48+
4949TARBALL_NAME=" ITKPythonBuilds-linux${TARBALL_SPECIALIZATION} .tar"
5050
5151if [[ ! -f ${TARBALL_NAME} .zst ]]; then
@@ -55,7 +55,7 @@ if [[ ! -f ./${TARBALL_NAME}.zst ]]; then
5555 echo " ERROR: can not find required binary './${TARBALL_NAME} .zst'"
5656 exit 255
5757fi
58- ./zstd-1.2.0-linux/bin/unzstd ./${TARBALL_NAME} .zst -o ${TARBALL_NAME}
58+ ${unzstd_exe} --long=31 ./${TARBALL_NAME} .zst -o ${TARBALL_NAME}
5959if [ " $# " -lt 1 ]; then
6060 echo " Extracting all files" ;
6161 tar xf ${TARBALL_NAME}
You can’t perform that action at this time.
0 commit comments