summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_makecompress.sh
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-05-28 14:28:44 +0200
committerRamón M. Gómez <ramongomez@us.es>2018-05-28 14:28:44 +0200
commitd47ec6caaea7496a7c286937a04b73b30f845e35 (patch)
tree3dfd8bf1f1167d67eff0cef53f44ec66f29fbf57 /installer/opengnsys_makecompress.sh
parent3e6051e6ec3ad064174dd4ac52dd7c5ae8fa13f7 (diff)
#840: Continuar sustitución de SVN por Git.
Diffstat (limited to 'installer/opengnsys_makecompress.sh')
-rwxr-xr-xinstaller/opengnsys_makecompress.sh23
1 files changed, 18 insertions, 5 deletions
diff --git a/installer/opengnsys_makecompress.sh b/installer/opengnsys_makecompress.sh
index ab05b5ce..0fbec746 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" | awk '{gsub(/[^0-9]/,""); print}')
# 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
+perl -pi -e "s/$/ $REVISION/" opengnsys/doc/VERSION.txt
# Generar fichero comprimido.
VERSION=$(awk '{print $2"-"$3}' opengnsys/doc/VERSION.txt)
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."