diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2020-06-09 10:25:06 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2020-06-09 10:25:06 +0200 |
commit | d42d7c7855919623e4498016d047af6aff30e19c (patch) | |
tree | 360cefba975f058d9968ae137e9b9760e9b0817c /installer | |
parent | f3499a31f648f2fe535491930e34347f71759480 (diff) |
#943: Fix a bug in getting Git tag data before updating.
Diffstat (limited to 'installer')
-rwxr-xr-x | installer/opengnsys_update.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index 38f8069c..f0a6f32f 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -184,7 +184,7 @@ function autoConfigure() # Choose an available version to update. function chooseVersion() { - local RELEASES DOWNLOADS INSTVERSION INSTRELEASE + local RELEASES DOWNLOADS INSTVERSION INSTRELEASE RELDATE # Development branch. BRANCH="master" @@ -199,10 +199,10 @@ function chooseVersion() # Fetch tags (releases) data from GitHub. while read -pe TAG URL; do if [[ $TAG =~ ^opengnsys- ]]; then - [ "${TAG#opengnsys-}" \< "${INSTVERSION%pre}" ] && break - RELEASES+=( "${TAG}" ) - DOWNLOADS+=( "$URL" ) - #RELDATE=$(curl -s "$URL" | jq -r '.commit.committer.date | split("-") | join("")[:8]') + [ "${TAG#opengnsys-}" \< "${INSTVERSION%pre}" ] && continue + RELDATE=$(curl -s "$URL" | jq -r '.commit.committer.date | split("-") | join("")[:8]') + RELEASES+=( "${TAG} ($RELDATE)" ) + DOWNLOADS+=( "$URL" ) fi done <<< $(curl -s "$API_URL/../../tags" | jq -r '.[] | .name+" "+.commit.url') # Add development (master) branch. @@ -212,10 +212,10 @@ function chooseVersion() if [ ${#RELEASES[@]} -gt 1 ]; then echo "Installed version: $INSTVERSION $INSTRELEASE" echo "Versions available for update (\"$BRANCH\" is the latest development branch):" - PS3="Enter a number: " + PS3="Enter a number (CTRL-C to exit): " select opt in "${RELEASES[@]}"; do if [ -n "$opt" ]; then - BRANCH="$opt" + BRANCH="${opt%% *}" API_URL="${DOWNLOADS[REPLY-1]}" break fi |