From 238ceb2df1b16cc1c34237b64b9223bae99933a9 Mon Sep 17 00:00:00 2001 From: Radek Szymczyszyn Date: Sat, 14 Oct 2017 22:37:19 -0400 Subject: Check OTP / docsh version compatibility --- kerl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kerl b/kerl index 7964756..07452ef 100755 --- a/kerl +++ b/kerl @@ -1105,8 +1105,6 @@ ACTIVATE_CSH } install_docsh() { - # TODO: SHOULD check version compatibility - REPO_URL=$DOCSH_GITHUB_URL GIT=$(echo -n $REPO_URL | $MD5SUM | cut -d ' ' -f $MD5SUM_FIELD) BUILDNAME=$1 @@ -1114,6 +1112,15 @@ install_docsh() { DOCSH_REF=kerl-install-docsh ACTIVE_PATH=$2 + OTP_VERSION=$(get_otp_version $1) + # This has to be updated with docsh updates + DOCSH_SUPPORTED="^1[89]$" + echo $OTP_VERSION | grep "$DOCSH_SUPPORTED" > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Erlang/OTP version $OTP_VERSION not supported by docsh (does not match regex $DOCSH_SUPPORTED)" + exit 1 + fi + mkdir -p "$KERL_GIT_DIR" || exit 1 cd "$KERL_GIT_DIR" || exit 1 echo "Checking out docsh git repository from ${REPO_URL}..." -- cgit v1.2.3