From: Ben Soares Date: Mon, 9 Mar 2020 12:11:13 +0000 (+0000) Subject: JAL-3227 slightly adapted download_jres.sh to make it easier to specify GNU tar on... X-Git-Tag: Develop-2_11_2_0-d20201215~58^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6de5e6cc905ac1415922cf4f1e11934cc8e502f1;p=jalview.git JAL-3227 slightly adapted download_jres.sh to make it easier to specify GNU tar on macos. 'TAR=gtar' --- diff --git a/utils/download_jres.sh b/utils/download_jres.sh index 5bfc26d..89ed8fc 100755 --- a/utils/download_jres.sh +++ b/utils/download_jres.sh @@ -18,6 +18,9 @@ JVM_IMPL=hotspot HEAP_SIZE=normal VENDOR=adoptopenjdk IMAGE_TYPE=jre +TAR=tar +ZIP=zip +UNZIP=unzip STRIP_MAC_APP_BUNDLING=false CREATE_ARCHIVES="zip tgz" @@ -29,7 +32,7 @@ RM=/bin/rm unzip-strip() ( local zip=$1 local dest=${2:-.} - local temp=$(mktemp -d) && unzip -qq -d "$temp" "$zip" && mkdir -p "$dest" && + local temp=$(mktemp -d) && $UNZIP -qq -d "$temp" "$zip" && mkdir -p "$dest" && shopt -s dotglob && local f=("$temp"/*) && if (( ${#f[@]} == 1 )) && [[ -d "${f[0]}" ]] ; then mv "$temp"/*/* "$dest" @@ -63,10 +66,10 @@ for FEATURE_VERSION in 8 11; do else echo "using tar" if [ x$OS = xmac -a x$STRIP_MAC_APP_BUNDLING = xtrue ]; then - tar --strip-components=3 -C "${JREDIR}" -zxf "${TARFILE}" "*/Contents/Home" + $TAR --strip-components=3 -C "${JREDIR}" -zxf "${TARFILE}" "*/Contents/Home" RET=$? else - tar --strip-components=1 -C "${JREDIR}" -zxf "${TARFILE}" + $TAR --strip-components=1 -C "${JREDIR}" -zxf "${TARFILE}" RET=$? fi fi @@ -87,14 +90,14 @@ for FEATURE_VERSION in 8 11; do ZIPFILE="${ABSARCHIVEDIR}/${NAME}.${CREATEARCHIVE}" [ -e "${ZIPFILE}" ] && $RM "${ZIPFILE}" cd ${NAME} - zip -X -r "${ZIPFILE}" "${IMAGE_TYPE}" + $ZIP -X -r "${ZIPFILE}" "${IMAGE_TYPE}" cd - ;; tgz) EXT=tar.gz echo "Creating ${NAME}.${EXT} for install4j bundling" [ \! -d ${ARCHIVEDIR} ] && mkdir -p "${ARCHIVEDIR}" - tar -C "${JREDIR}" -zcf "${ARCHIVEDIR}/${NAME}.${EXT}" . + $TAR -C "${JREDIR}" -zcf "${ARCHIVEDIR}/${NAME}.${EXT}" . ;; *) echo "Archiving as '${CREATEARCHIVE}' file not supported"