diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-11-26 17:04:35 +0100 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-11-26 17:04:35 +0100 |
commit | 23b34416176c840feef01df3755429add4d92e93 (patch) | |
tree | 0ad226e2a8d2745552f6c4b898accb4245656d5e /installer/opengnsys_update.sh | |
parent | c74dbb25d6d2c5fe45042174819c0ee6f725a1cb (diff) |
#872: Adapting commit {{{5f0c2dd}}} from devel to master branch.
Diffstat (limited to 'installer/opengnsys_update.sh')
-rwxr-xr-x | installer/opengnsys_update.sh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index 0f976497..b243df25 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -434,7 +434,7 @@ function checkVersion() if [ $REMOTE -eq 1 ]; then NEWVERSION=$(curl -s $RAW_URL/doc/VERSION.txt 2>/dev/null | awk '{print $2}') else - NEWVERSION=$(awk '{print $2}' $PROGRAMDIR/doc/VERSION.txt 2>/dev/null) + NEWVERSION=$(awk '{print $2}' $PROGRAMDIR/../doc/VERSION.txt 2>/dev/null) fi [[ "$NEWVERSION" =~ pre ]] && PRE=1 @@ -956,7 +956,7 @@ function updateClient() oglivecli convert fi # Comprobar si debe actualizarse el cliente. - SOURCELENGTH=$(curl -sI $SOURCEFILE 2>&1 | awk '/Content-Length:/ {print $2}') + SOURCELENGTH=$(curl -sI $SOURCEFILE 2>&1 | awk '/Content-Length:/ {gsub("\r", ""); print $2}') TARGETLENGTH=$(stat -c "%s" $TARGETFILE 2>/dev/null) [ -z $TARGETLENGTH ] && TARGETLENGTH=0 if [ "$SOURCELENGTH" != "$TARGETLENGTH" ]; then @@ -1028,9 +1028,14 @@ function updateSummary() # Actualizar fichero de versión y revisión. local VERSIONFILE REVISION VERSIONFILE="$INSTALL_TARGET/doc/VERSION.txt" - # Revisión: rAñoMesDía.Gitcommit (8 caracteres de fecha y 7 primeros de commit). - REVISION=$(curl -s "$API_URL" | jq -r '"r" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])') - + # Obtener revisión. + if [ $REMOTE -eq 1 ]; then + # Revisión: rAñoMesDía.Gitcommit (8 caracteres de fecha y 7 primeros de commit). + REVISION=$(curl -s "$API_URL" | jq -r '"r" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])') + else + # Leer revisión del fichero de versiones. + REVISION=$(awk '{print $3}' $PROGRAMDIR/../doc/VERSION.txt 2>/dev/null) + fi [ -f $VERSIONFILE ] || echo "OpenGnsys" >$VERSIONFILE sed -ri "s/($| r[.0-9a-f]+)/ $REVISION/" $VERSIONFILE |