File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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]+' \
You can’t perform that action at this time.
0 commit comments