Filter out RCs

This commit is contained in:
Tianon Gravi 2015-02-27 14:33:33 -07:00
parent 1fc771798d
commit 9ef507b336
1 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,8 @@ versions=( "${versions[@]%/}" )
for version in "${versions[@]}"; do
# <span class="release-number"><a href="/downloads/release/python-278/">Python 2.7.8</a></span>
# <span class="release-number"><a href="/downloads/release/python-341/">Python 3.4.1</a></span>
fullVersion="$(curl -sSL 'https://www.python.org/downloads/' | awk -F 'Python |</a>' '/<span class="release-number"><a[^>]+>Python '"$version"'./ { print $2 }' | sort -V | tail -1)"
fullVersion="$(curl -sSL 'https://www.python.org/downloads/' | awk -F 'Python |</a>' '/<span class="release-number"><a[^>]+>Python '"$version"'./ { print $2 }' | grep -v 'rc' | sort -V | tail -1)"
# TODO figure out a better want to handle RCs than just filtering them out wholesale
(
set -x
sed -ri 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' "$version"/{,slim/,wheezy/}Dockerfile