fix(build): also make SYSTEM configurable by env variable

This commit is contained in:
Shawn 2022-02-28 19:07:38 +08:00
parent b7d07d7a96
commit f25b8801b4
3 changed files with 4 additions and 3 deletions

2
build
View File

@ -18,7 +18,7 @@ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")"
PKG_VSN="${PKG_VSN:-$(./pkg-vsn.sh)}"
export PKG_VSN
SYSTEM="$(./scripts/get-distro.sh)"
SYSTEM="${SYSTEM:-$(./scripts/get-distro.sh)}"
##
## Support RPM and Debian based linux systems

View File

@ -27,7 +27,7 @@ esac
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
OTP_VSN="${OTP_VSN:-$(./scripts/get-otp-vsn.sh)}"
SYSTEM="$(./scripts/get-distro.sh)"
SYSTEM="${SYSTEM:-$(./scripts/get-distro.sh)}"
UNAME="$(uname -m)"
case "$UNAME" in

View File

@ -62,10 +62,11 @@ pushd _upgrade_base
for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do
filename="$PROFILE-${tag#[e|v]}-otp$OTP_VSN-$SYSTEM-$ARCH.zip"
url="https://www.emqx.com/downloads/$DIR/${tag#[e|v]}/$filename"
echo "downloading base package from ${url} ..."
if [ ! -f "$filename" ] && curl -I -m 10 -o /dev/null -s -w "%{http_code}" "${url}" | grep -q -oE "^[23]+" ; then
echo "downloading base package from ${url} ..."
curl -L -o "${filename}" "${url}"
if [ "$SYSTEM" != "centos6" ]; then
echo "downloading sha256 sum from ${url}.sha256 ..."
curl -L -o "${filename}.sha256" "${url}.sha256"
SUMSTR=$(cat "${filename}.sha256")
echo "got sha265sum: ${SUMSTR}"