diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-06-14 10:48:39 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-06-14 10:59:34 +0200 |
commit | b60d6b807c580e58f06a337def9a1a83b1f3bcfc (patch) | |
tree | 7ee39403eb4f70a9f7120eb8168d6317b339bf1e /installer/opengnsys_makecompress.sh | |
parent | 5367fb5e61f2e89797bfe7df0e4811a1ff890f08 (diff) | |
parent | e0e4c021382f2c8a66402c545229aa8e528750f9 (diff) |
#794: Applying new commits from {{{devel}}} branch to {{{pjlink}}} branch.
Diffstat (limited to 'installer/opengnsys_makecompress.sh')
-rwxr-xr-x | installer/opengnsys_makecompress.sh | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/installer/opengnsys_makecompress.sh b/installer/opengnsys_makecompress.sh index ab05b5ce..ff267b1e 100755 --- a/installer/opengnsys_makecompress.sh +++ b/installer/opengnsys_makecompress.sh @@ -7,28 +7,41 @@ # Versión: 1.0 - Incluido en OpenGnSys 1.0.1 # Autor: Ramón Gómez, Universidad de Sevilla # Fecha: 10/05/2011 +# Versión: 1.1.1 - Descarga desde repositorio de GitHub +# Autor: Ramón Gómez, Universidad de Sevilla +# Fecha: 27/05/2018 + +# Comprobaciones. +for PROG in jq unzip; do + if ! which $PROG &>/dev/null; then + echo "Please, install \"$PROG\" package." + exit 1 + fi +done # Variables -SVNURL="https://opengnsys.es/svn/branches/version1.1/" -SVNREV=$(LANG=C svn info $SVNURL | awk '/Last Changed Rev:/ {print "r"$4}') +BRANCH="devel" +CODE_URL="https://codeload.github.com/opengnsys/OpenGnsys/zip/$BRANCH" +API_URL="https://api.github.com/repos/opengnsys/OpenGnsys/branches/$BRANCH" +REVISION=$(curl -s "$API_URL" | jq '"r" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])') # Descargar repositorio SVN cd /tmp rm -fr opengnsys -svn export $SVNURL opengnsys || exit 1 +curl "$CODE_URL" -o opengnsys.zip && unzip opengnsys.zip && mv "OpenGnsys-$BRANCH" opengnsys # Asisgnar propietario de los ficheros descargados. chown -R root.root opengnsys WARNING=$? # Parchear datos de revisión del código. -perl -pi -e "s/$/ $SVNREV/" opengnsys/doc/VERSION.txt +jq ".release=$REVISION" opengnsys/doc/VERSION.json | sponge opengnsys/doc/VERSION.json # Generar fichero comprimido. -VERSION=$(awk '{print $2"-"$3}' opengnsys/doc/VERSION.txt) +VERSION=$(jq -r '.version+"-"+.release' opengnsys/doc/VERSION.json) tar cvzf opengnsys-$VERSION.tar.gz opengnsys -rm -fr opengnsys +rm -fr opengnsys opengnsys.zip # Revisar salida. [ $WARNING != 0 ] && echo "*** WARNING: cannot change owner of files to \"root\" user before compressing." |