summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_update.sh
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-06-12 11:54:56 +0200
committerRamón M. Gómez <ramongomez@us.es>2018-06-12 11:54:56 +0200
commit3bbaf79bf5961f05f2a6f278f6f222b8e3ba49f7 (patch)
treecc98b2a705b92d88f937aec04ca5d82d1f1377dd /installer/opengnsys_update.sh
parent22087adb0242fbd6ed6896a6227bb41c1c1af668 (diff)
#843: Installer and updater use new version file.
Diffstat (limited to 'installer/opengnsys_update.sh')
-rwxr-xr-xinstaller/opengnsys_update.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index f8689673..642d948d 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -1028,17 +1028,19 @@ function updateSummary()
{
# Actualizar fichero de versión y revisión.
local VERSIONFILE REVISION
- VERSIONFILE="$INSTALL_TARGET/doc/VERSION.txt"
+ 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 '"r" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])')
-
- [ -f $VERSIONFILE ] || echo "OpenGnsys" >$VERSIONFILE
- 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])')
+ [ -f $VERSIONFILE ] || echo '{ "project": "OpenGnsys" }' > $VERSIONFILE
+ jq ".release=$REVISION" $VERSIONFILE | sponge $VERSIONFILE
+ VERSION="$(jq -r '[.project, .version, .codename, .release] | join(" ")' $VERSIONFILE 2>/dev/null)"
+ # Borrar antiguo fichero de versión.
+ rm -f "${VERSIONFILE/json/txt}"
echo
echoAndLog "OpenGnsys Update Summary"
echo "========================"
- echoAndLog "Project version: $(cat $VERSIONFILE)"
+ echoAndLog "Project version: $VERSION"
echoAndLog "Update log file: $LOG_FILE"
if [ -n "$NEWFILES" ]; then
echoAndLog "Check new config files: $(echo $NEWFILES)"