From 59e4eafd9dc0f201dc3d8323410a503761a0875c Mon Sep 17 00:00:00 2001 From: Alexander Maretskiy Date: Mon, 25 Apr 2016 19:58:22 +0300 Subject: [PATCH] [Install] Fix installation script This is expected to unlock our gate-rally-install-* jobs Change-Id: Id1e6ee88560883bb895fc7f561ef210723fff7ad --- install_rally.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install_rally.sh b/install_rally.sh index 62597d9bab..1184816ee3 100755 --- a/install_rally.sh +++ b/install_rally.sh @@ -275,7 +275,19 @@ download() { download_from_pypi () { local pkg=$1 - local url=$(download - "$BASE_PIP_URL"/"$pkg"/ | sed -n '/source\/.\/'"$pkg"'.*gz/ { s:.*href="\([^#"]*\)["#].*:\1:g; p; }' | sort | tail -1) + + # NOTE(amaretskiy): get packages list in HTML + local packages=$(download - "${BASE_PIP_URL}/${pkg}/") + + # NOTE(amaretskiy): filter packages URLs + packages=$(echo ${packages} | sed -En "s/.*href=\"(.*${pkg}-.*\\.gz)\#.*/\1/p") + + # NOTE(amaretskiy): sort packages URLs by their version part + packages=$(echo ${packages} | sort -t / -k 7 -V) + + # NOTE(amaretskiy): finally, the URL is in the last line + local url=$(echo ${packages} | tail -1) + if [ -n "$url" ]; then download "$(basename "$url")" "$BASE_PIP_URL"/"$pkg"/"$url" else