This is an automated email from the ASF dual-hosted git repository. tomaz pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 926731d1877fa76aee248faf635fc6c3c9a1435b Author: Tomaz Muraus <[email protected]> AuthorDate: Thu Nov 11 20:59:36 2021 +0100 Update verify checksum scripts to also handle wheel files and remove .tar.bz2 check since we haven't been uploading .tar.bz2 files for a while now. --- dist/verify_checksums.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/dist/verify_checksums.sh b/dist/verify_checksums.sh index c739dd1..90357b5 100755 --- a/dist/verify_checksums.sh +++ b/dist/verify_checksums.sh @@ -19,20 +19,22 @@ VERSION=$1 -if [ ! ${VERSION} ]; then +if [ ! "${VERSION}" ]; then echo "Usage: ${0} <version name>" - echo "For example: ${0} apache-libcloud-0.13.2" + echo "For example: ${0} apache-libcloud-3.4.0" exit 1 fi -TMP_DIR=`mktemp -d` +TMP_DIR=$(mktemp -d) -EXTENSIONS[0]="tar.gz" -EXTENSIONS[1]="tar.bz2" -EXTENSIONS[2]="zip" +# TODO: Use json endpoint + jq to parse out the url +# https://pypi.org/pypi/apache-libcloud/3.4.0/json +EXTENSIONS[0]=".tar.gz" +EXTENSIONS[1]="-py2.py3-none-any.whl" APACHE_MIRROR_URL="http://www.apache.org/dist/libcloud" -PYPI_MIRROR_URL="https://pypi.python.org/packages/source/a/apache-libcloud" +PYPI_MIRROR_URL_SOURCE="https://pypi.python.org/packages/source/a/apache-libcloud" +PYPI_MIRROR_URL_WHEEL="https://files.pythonhosted.org/packages/py2.py3/a/apache-libcloud" # From http://tldp.org/LDP/abs/html/debugging.html#ASSERT function assert () # If condition false, @@ -49,7 +51,7 @@ function assert () # If condition false, lineno=$2 - if [ ! $1 ] + if [ ! "$1" ] then echo "Assertion failed: \"$1\"" echo "File \"$0\", line $lineno" # Give name of file and line number. @@ -65,11 +67,21 @@ echo "" for (( i = 0 ; i < ${#EXTENSIONS[@]} ; i++ )) do extension=${EXTENSIONS[$i]} - file_name="${VERSION}.${extension}" + file_name="${VERSION}${extension}" + + if [ "${extension}" = "-py2.py3-none-any.whl" ]; then + file_name=$(echo ${file_name} | sed "s/apache-libcloud/apache_libcloud/g") + fi apache_url="${APACHE_MIRROR_URL}/${file_name}" pypi_url="${PYPI_MIRROR_URL}/${file_name}" + if [ "${extension}" = "-py2.py3-none-any.whl" ]; then + pypi_url="${PYPI_MIRROR_URL_WHEEL}/${file_name}" + else + pypi_url="${PYPI_MIRROR_URL_SOURCE}/${file_name}" + fi + assert "${apache_url} != ${pypi_url}", "URLs must be different" file_name_apache="${file_name}-apache"
