aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-base/bin
diff options
context:
space:
mode:
authorM.Gergo2021-05-17 17:50:05 +0200
committerM.Gergo2021-05-17 17:50:05 +0200
commitef8b3fd973fa34b303370d5acc21744e57bca507 (patch)
tree67a42f55b0f36f024c33d8892c1112e8c5746556 /mayor-orig/mayor-base/bin
parentfb24a50c54d5776468e49def08aea44c4077eb47 (diff)
downloadmayor-9a5ff053333831a6affc9a9a10ab166f75c9d2b6.tar.gz
mayor-9a5ff053333831a6affc9a9a10ab166f75c9d2b6.zip
Rev: 4787rev4787
Diffstat (limited to 'mayor-orig/mayor-base/bin')
-rwxr-xr-xmayor-orig/mayor-base/bin/install-composer.sh17
-rw-r--r--mayor-orig/mayor-base/bin/update.sh24
2 files changed, 38 insertions, 3 deletions
diff --git a/mayor-orig/mayor-base/bin/install-composer.sh b/mayor-orig/mayor-base/bin/install-composer.sh
new file mode 100755
index 00000000..a61aff80
--- /dev/null
+++ b/mayor-orig/mayor-base/bin/install-composer.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
+php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
+
+if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
+then
+ >&2 echo 'ERROR: Invalid installer checksum'
+ rm composer-setup.php
+ exit 1
+fi
+
+php composer-setup.php --quiet
+RESULT=$?
+rm composer-setup.php
+exit $RESULT
diff --git a/mayor-orig/mayor-base/bin/update.sh b/mayor-orig/mayor-base/bin/update.sh
index 39338119..507347d4 100644
--- a/mayor-orig/mayor-base/bin/update.sh
+++ b/mayor-orig/mayor-base/bin/update.sh
@@ -160,11 +160,12 @@ if [ "$EXECONLY" != "1" ]; then
rm -rf $TMPDIR/*
fi
cd $TMPDIR
- # Az md5sum állomány leszedáse
+ # Az md5sum állomány
+ PHP_VERSION=`php -r "echo phpversion();"`
if [ -z $VERSION ]; then
- wget "http://www.mayor.hu/download/md5sum"
+ wget --output-file=md5sum "http://www.mayor.hu/download/md5sum?php_version=${PHP_VERSION}"
else
- wget "http://www.mayor.hu/download/$VERSION/md5sum"
+ wget --output-file=md5sum "http://www.mayor.hu/download/$VERSION/md5sum?php_version=${PHP_VERSION}"
if [[ ! $HTTP_SERVER =~ .*$VERSION.* ]]; then HTTP_SERVER="$HTTP_SERVER/$VERSION"; fi
fi
if [ $? != 0 ]; then exit 5; fi
@@ -220,6 +221,23 @@ echo -e "\nMaYoR TeX formátum állomány újragenerálása... "
cd $BASEDIR/print/module-naplo/tex/ && fmtutil-sys --cnffile $BASEDIR/print/module-naplo/tex/mayor.cnf --fmtdir $BASEDIR/print/module-naplo/ --byfmt mayor > /dev/null 2>&1
echo -e "\nMaYoR XeTeX formátum állomány újragenerálása... "
cd $BASEDIR/print/module-naplo/xetex/ && fmtutil-sys --cnffile $BASEDIR/print/module-naplo/xetex/mayor-xetex.cnf --fmtdir $BASEDIR/print/module-naplo/ --byfmt mayor-xetex > /dev/null 2>&1
+
+if [ -f "$BASEDIR/bin/composer.phar" ]; then
+ echo "Composer ok."
+else
+ echo "Composer install..."
+ cd $BASEDIR/bin/ && bash install-composer.sh
+fi
+if [ -f "$BASEDIR/bin/composer.phar" ]; then
+ echo "Composer ok."
+ echo "Composer installed."
+ echo "Composer optimize: "
+ cd $BASEDIR/www/; php ../bin/composer.phar --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader install
+ echo "Composer deploy done."
+else
+ echo "ERROR: Composer install FAILED! Contact support support@mayor.hu"
+fi
+
cd $PWDTEX
echo 'kész.'