Skip to content

Commit 98e0d5c

Browse files
committed
Account for overaggressive varnish even more in update.sh
1 parent a1aa406 commit 98e0d5c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

update.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ for version in "${versions[@]}"; do
5757
possibles=( $(
5858
{
5959
git ls-remote --tags https://github.com/python/cpython.git "refs/tags/v${rcVersion}.*" \
60-
| sed -r 's!^.*refs/tags/v([0-9.]+).*$!\1!' \
60+
| sed -r 's!^.*refs/tags/v([0-9a-z.]+).*$!\1!' \
6161
|| :
6262
6363
# this page has a very aggressive varnish cache in front of it, which is why we also scrape tags from GitHub
@@ -68,9 +68,22 @@ for version in "${versions[@]}"; do
6868
} | sort -ruV
6969
) )
7070
fullVersion=
71+
declare -A impossible=()
7172
for possible in "${possibles[@]}"; do
73+
rcPossible="${possible%[a-z]*}"
74+
75+
# varnish is great until it isn't
76+
if wget -q -O /dev/null -o /dev/null --spider "https://www.python.org/ftp/python/$rcPossible/Python-$possible.tar.xz"; then
77+
fullVersion="$possible"
78+
break
79+
fi
80+
81+
if [ -n "${impossible[$rcPossible]:-}" ]; then
82+
continue
83+
fi
84+
impossible[$rcPossible]=1
7285
possibleVersions=( $(
73-
curl -fsSL "https://www.python.org/ftp/python/$possible/" \
86+
wget -qO- -o /dev/null "https://www.python.org/ftp/python/$rcPossible/" \
7487
| grep '<a href="Python-'"$rcVersion"'.*\.tar\.xz"' \
7588
| sed -r 's!.*<a href="Python-([^"/]+)\.tar\.xz".*!\1!' \
7689
| grep $rcGrepV -E -- '[a-zA-Z]+' \

0 commit comments

Comments
 (0)