build: do not skip downloading relup base package

do not skip downloading only because of curl error
for known missing base packages, we should list them in the script
This commit is contained in:
Zaiming (Stone) Shi 2022-09-14 19:43:00 +02:00
parent 4597344881
commit 2fbb79f84f
1 changed files with 11 additions and 9 deletions

View File

@ -57,15 +57,17 @@ for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do
filename="$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip"
url="https://packages.emqx.io/$DIR/$tag/$filename"
echo "downloading base package from ${url} ..."
if [ ! -f "$filename" ] && curl -L -I -m 10 -o /dev/null -s -w "%{http_code}" "${url}" | grep -q -oE "^[23]+" ; then
curl -L -o "${filename}" "${url}"
if [ "$SYSTEM" != "centos6" ]; then
curl -L -o "${filename}.sha256" "${url}.sha256"
SUMSTR=$(cat "${filename}.sha256")
echo "got sha265sum: ${SUMSTR}"
## https://askubuntu.com/questions/1202208/checking-sha256-checksum
echo "${SUMSTR} ${filename}" | $SHASUM -c || exit 1
fi
if [ -f "$filename" ]; then
echo "file $filename already downloaded; skikpped"
continue
fi
curl -L -o "${filename}" "${url}"
if [ "$SYSTEM" != "centos6" ]; then
curl -L -o "${filename}.sha256" "${url}.sha256"
SUMSTR=$(cat "${filename}.sha256")
echo "got sha265sum: ${SUMSTR}"
## https://askubuntu.com/questions/1202208/checking-sha256-checksum
echo "${SUMSTR} ${filename}" | $SHASUM -c || exit 1
fi
done