Also determine latest version in a branch over https

This commit is contained in:
Anton Tieleman 2017-02-01 19:23:30 +01:00
parent 35951c2bdc
commit 97f7ec7881
1 changed files with 4 additions and 4 deletions

View File

@ -267,14 +267,14 @@ elif [ -n "${BRANCH}" ]; then
# Valid version number, determine latest version # Valid version number, determine latest version
else else
echo "Checking latest version of ${BRANCH} branch on ftp.openssl.org..." echo "Checking latest version of ${BRANCH} branch on openssl.org..."
# Get directory content of /source/ (only contains latest version per branch), limit list to archives (so one archive per branch), # Get directory content listing of /source/ (only contains latest version per branch), limit list to archives (so one archive per branch),
# filter for the requested branch, sort the list and get the last item (last two steps to ensure there is always 1 result) # filter for the requested branch, sort the list and get the last item (last two steps to ensure there is always 1 result)
VERSION=$(curl ${CURL_OPTIONS} -ls ftp://ftp.openssl.org/source/ | grep -Eo '^openssl-[0-9]\.[0-9]\.[0-9][a-z]*\.tar\.gz$' | grep -Eo "${BRANCH//./\.}[a-z]*" | sort | tail -1) VERSION=$(curl ${CURL_OPTIONS} -s https://ftp.openssl.org/source/ | grep -Eo '>openssl-[0-9]\.[0-9]\.[0-9][a-z]*\.tar\.gz<' | grep -Eo "${BRANCH//./\.}[a-z]*" | sort | tail -1)
# Verify result # Verify result
if [ -z "${VERSION}" ]; then if [ -z "${VERSION}" ]; then
echo "Could not determine latest version, please check https://openssl.org/source/ and use --version option" echo "Could not determine latest version, please check https://www.openssl.org/source/ and use --version option"
exit 1 exit 1
fi fi
fi fi