summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_update.sh
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-11-26 14:32:06 +0100
committerRamón M. Gómez <ramongomez@us.es>2018-11-26 14:32:06 +0100
commit5f0c2dd54ff4b9702468691de5174728fb7b0e33 (patch)
tree32d79a34f2dab1d8984ee0914d6562b532469c76 /installer/opengnsys_update.sh
parentde8c4ea7495184e1cb75ad518a1970340dc88f93 (diff)
#879: Checking paths and sizes in update script.
Diffstat (limited to 'installer/opengnsys_update.sh')
-rwxr-xr-xinstaller/opengnsys_update.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index a522434a..75decd18 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -468,7 +468,7 @@ function checkVersion()
if [ $REMOTE -eq 1 ]; then
NEWVERSION=$(curl -s $RAW_URL/doc/VERSION.json 2>/dev/null | jq -r '.version')
else
- NEWVERSION=$(jq -r '.version' $PROGRAMDIR/doc/VERSION.json 2>/dev/null)
+ NEWVERSION=$(jq -r '.version' $PROGRAMDIR/../doc/VERSION.json 2>/dev/null)
fi
[[ "$NEWVERSION" =~ pre ]] && PRE=1
@@ -993,7 +993,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
@@ -1065,8 +1065,14 @@ function updateSummary()
# Actualizar fichero de versión y revisión.
local VERSIONFILE REVISION
VERSIONFILE="$INSTALL_TARGET/doc/VERSION.json"
- # Revisión: rAñoMesDía.Gitcommit (8 caracteres de fecha y 7 primeros de commit).
- REVISION=$(curl -s "$API_URL" | jq '"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" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])')
+ else
+ # Parámetro "release" del fichero JSON.
+ REVISION=$(jq -r '.release' $PROGRAMDIR/../doc/VERSION.json 2>/dev/null)
+ fi
[ -f $VERSIONFILE ] || echo '{ "project": "OpenGnsys" }' > $VERSIONFILE
jq ".release=$REVISION" $VERSIONFILE | sponge $VERSIONFILE
VERSION="$(jq -r '[.project, .version, .codename, .release] | join(" ")' $VERSIONFILE 2>/dev/null)"