Skip to content

Commit 27dbfb6

Browse files
authored
Merge pull request #2097 from apache/fix_verify_checksum
Fix verify_checksums.sh script
2 parents cb48d39 + 7f2c0ed commit 27dbfb6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dist/verify_checksums.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ TMP_DIR=$(mktemp -d)
3030
# TODO: Use json endpoint + jq to parse out the url
3131
# https://pypi.org/pypi/apache-libcloud/3.4.0/json
3232
EXTENSIONS[0]=".tar.gz"
33-
EXTENSIONS[1]="-py3-none-any.whl"
33+
EXTENSIONS[1]="-py2.py3-none-any.whl"
3434

3535
APACHE_MIRROR_URL="http://www.apache.org/dist/libcloud"
3636
PYPI_MIRROR_URL_SOURCE="https://pypi.python.org/packages/source/a/apache-libcloud"
37-
PYPI_MIRROR_URL_WHEEL="https://files.pythonhosted.org/packages/py3/a/apache-libcloud"
37+
PYPI_SIMPLE_URL="https://pypi.org/simple/apache-libcloud/"
3838

3939
# From http://tldp.org/LDP/abs/html/debugging.html#ASSERT
4040
function assert () # If condition false,
@@ -69,16 +69,17 @@ do
6969
extension=${EXTENSIONS[$i]}
7070
file_name="${VERSION}${extension}"
7171

72-
if [ "${extension}" = "-py3-none-any.whl" ]; then
72+
if [ "${extension}" = "-py2.py3-none-any.whl" ]; then
7373
# shellcheck disable=SC2001
7474
file_name=$(echo "${file_name}" | sed "s/apache-libcloud/apache_libcloud/g")
7575
fi
7676

7777
apache_url="${APACHE_MIRROR_URL}/${file_name}"
7878
pypi_url="${PYPI_MIRROR_URL}/${file_name}"
7979

80-
if [ "${extension}" = "-py3-none-any.whl" ]; then
81-
pypi_url="${PYPI_MIRROR_URL_WHEEL}/${file_name}"
80+
if [ "${extension}" = "-py2.py3-none-any.whl" ]; then
81+
# Get the wheel full URL from PyPi Simple index
82+
pypi_url=$(curl -s ${PYPI_SIMPLE_URL} | grep "${file_name}" | sed -n 's/.*href="\([^"]*\)".*/\1/p')
8283
else
8384
pypi_url="${PYPI_MIRROR_URL_SOURCE}/${file_name}"
8485
fi

0 commit comments

Comments
 (0)