summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_installer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'installer/opengnsys_installer.sh')
-rwxr-xr-xinstaller/opengnsys_installer.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 7d41bd6b..523aaaf2 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -1556,21 +1556,22 @@ function installationSummary()
local VERSIONFILE REVISION
# Crear fichero de versión y revisión, si no existe.
- VERSIONFILE="$INSTALL_TARGET/doc/VERSION.txt"
- [ -f $VERSIONFILE ] || echo "OpenGnsys Server" >$VERSIONFILE
- # Incluir datos de revisión, si se está instaladno desde el repositorio
+ VERSIONFILE="$INSTALL_TARGET/doc/VERSION.json"
+ [ -f $VERSIONFILE ] || echo '{ "project": "OpenGnsys" }' >$VERSIONFILE
+ # Incluir datos de revisión, si se está instalando desde el repositorio
# de código o si no está incluida en el fichero de versión.
- if [ $REMOTE -eq 1 ] || [ -z "$(awk '$3~/r[0-9]*/ {print}' $VERSIONFILE)" ]; then
+ if [ $REMOTE -eq 1 ] || [ -z "$(jq -r '.release' $VERSIONFILE)" ]; 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])')
- sed -ri "s/($| r[.0-9a-f]+)/ $REVISION/" $VERSIONFILE
+ REVISION=$(curl -s "$API_URL" | jq '"r" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])')
+ jq ".release=$REVISION" $VERSIONFILE | sponge $VERSIONFILE
fi
+ VERSION="$(jq -r '[.project, .version, .codename, .release] | join(" ")' $VERSIONFILE 2>/dev/null)"
# Mostrar información.
echo
echoAndLog "OpenGnsys Installation Summary"
echo "=============================="
- echoAndLog "Project version: $(cat $VERSIONFILE 2>/dev/null)"
+ echoAndLog "Project version: $VERSION"
echoAndLog "Installation directory: $INSTALL_TARGET"
echoAndLog "Installation log file: $LOG_FILE"
echoAndLog "Repository directory: $INSTALL_TARGET/images"