From b9d0cdfa10e7490ceb5010901f9eff02b1803cab Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 7 Mar 2019 15:08:08 -0800 Subject: [PATCH] Adjust "update.sh" to walk backwards through tags until it finds one with the artifacts we require/use See https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.8.0-beta.3, for example (no uploaded artifacts, so not usable). --- update.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/update.sh b/update.sh index f623759..31b943d 100755 --- a/update.sh +++ b/update.sh @@ -13,9 +13,6 @@ versions=( "${versions[@]%/}" ) declare -A otpMajors=( [3.7]='21' [3.8]='21' - - # temporary - [3.7.9]='21' ) # https://www.openssl.org/policies/releasestrat.html @@ -23,9 +20,6 @@ declare -A otpMajors=( declare -A opensslMajors=( [3.7]='1.1' [3.8]='1.1' - - # temporary - [3.7.9]='1.1' ) # TODO will these always be signed by Matt Caswell? (https://www.openssl.org/community/omc.html) @@ -41,24 +35,31 @@ for version in "${versions[@]}"; do rcGrepV+=' -E' rcGrepExpr='beta|milestone|rc' - githubTag="$( + githubTags=( $( git ls-remote --tags https://github.com/rabbitmq/rabbitmq-server.git \ "refs/tags/v${rcVersion}"{'','.*','-*','^*'} \ | cut -d'/' -f3- \ | cut -d'^' -f1 \ | grep $rcGrepV -- "$rcGrepExpr" \ - | sort -uV \ - | tail -1 - )" + | sort -urV + ) ) - fullVersion="$( - wget -qO- "https://github.com/rabbitmq/rabbitmq-server/releases/tag/$githubTag" \ - | grep -oE "/rabbitmq-server-generic-unix-${rcVersion}([.-].+)?[.]tar[.]xz" \ - | head -1 \ - | sed -r "s/^.*(${rcVersion}.*)[.]tar[.]xz/\1/" - )" - - if [ -z "$fullVersion" ]; then + fullVersion= + githubTag= + for possibleTag in "${githubTags[@]}"; do + fullVersion="$( + wget -qO- "https://github.com/rabbitmq/rabbitmq-server/releases/tag/$possibleTag" \ + | grep -oE "/rabbitmq-server-generic-unix-${rcVersion}([.-].+)?[.]tar[.]xz" \ + | head -1 \ + | sed -r "s/^.*(${rcVersion}.*)[.]tar[.]xz/\1/" \ + || : + )" + if [ -n "$fullVersion" ]; then + githubTag="$possibleTag" + break + fi + done + if [ -z "$fullVersion" ] || [ -z "$githubTag" ]; then echo >&2 "warning: failed to get full version for '$version'; skipping" continue fi