diff --git a/CHANGES.txt b/CHANGES.txt index 2438934..bbb2345 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -72,6 +72,10 @@ Outre ces changements, voici d'autres changements importants : ======= CHANGES ======= ------- +24/07/2020 v3.7.9.72 (EP) + - (i) Fiabilisation du nouveau script database/update/db-update.sh + +------- 23/07/2020 v3.7.9.69-71 (EP) - (b) Bugfix OrganismesController getArticle => public - .gitignore modifs : ignorer dossier Eclipse .metadata/... diff --git a/README.md b/README.md index 1c9f9c6..fdfcb0a 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ Logiciel testé et validé sur les configurations suivantes : -------------------------------------------------------------------------------------------- -Date: 23/07/2020 -Version: 3.7.9.71 +Date: 24/07/2020 +Version: 3.7.9.72 HISTORIQUE DES CHANGEMENTS DE VERSION : voir le fichier CHANGES.txt (ou la page web /pages/changes) diff --git a/database/update/db-update.sh b/database/update/db-update.sh index 5130dbd..b187f13 100755 --- a/database/update/db-update.sh +++ b/database/update/db-update.sh @@ -2,7 +2,7 @@ # Pour Mac OS recent (>=10.10, Yosemite), la syntaxe du SED est differente # Il faut donc exécuter ce script de la manière suivante : -# ./macos-db-update.sh +# ./macos-db-update.sh db-update-AAAA-MM-JJ.sql if [ ! -f ../../config/app.php ] ; then @@ -26,10 +26,10 @@ function abort() { # Exit si ce script n'existe pas -#if [[ ! -f ./script_sql/$sqlscript ]] ; then -if [[ ! -f ./$sqlscript ]] ; then - #echo "Le script SQL script_sql/$sqlscript n'existe pas" - echo "Le script SQL $sqlscript n'existe pas" +# Juste le nom du script sql, sans le path qui pourrait être devant +sqlscript=$(basename $sqlscript) +if [[ ! -f ./script_sql/$sqlscript ]] ; then + echo "Le script SQL ./script_sql/$sqlscript n'existe pas" abort fi @@ -39,10 +39,6 @@ sqlscript_name=${sqlscript%%.*} #echo $sqlscript_name - - - - # Get login, pass, dbname, and hostname username=$(grep "/\*d\*/'username'" ../../config/app.php | cut -d"'" -f4) || abort password=$(grep "/\*d\*/'password'" ../../config/app.php | cut -d"'" -f4) || abort @@ -52,21 +48,19 @@ host=$(grep "/\*d\*/'host'" ../../config/app.php | cut -d"'" -f4) || abort #cp -p ./script_sql/db-update-2016-07-01-irap.sql ./script_sql/db-update-2016-07-01-irap-build.sql #cp -p ./script_sql/$sqlscript.sql ./script_sql/$sqlscript-build.sql || abort -#cp -p ./script_sql/$sqlscript_name.sql ./script_sql/$sqlscript_name-build.sql || abort -cp -p ./$sqlscript_name.sql ./$sqlscript_name-build.sql || abort +cp -p ./script_sql/$sqlscript_name.sql ./script_sql/$sqlscript_name-build.sql || abort +#ls -l ./script_sql/ # Execute sql update script -#sed -e "s/database/$database/" -i ./script_sql/$sqlscript-build.sql || abort -sed -e "s/database/$database/" -i ./$sqlscript_name-build.sql || abort +sed -e "s/database/$database/" -i ./script_sql/$sqlscript_name-build.sql || abort -#mysql --user=$username --password=$password -h $host < ./script_sql/$sqlscript_name-build.sql || abort -mysql --user=$username --password=$password -h $host < ./$sqlscript_name-build.sql || abort +mysql --user=$username --password=$password -h $host < ./script_sql/$sqlscript_name-build.sql || abort # Delete temporary file and cakephp cache (-f avoids warning if no file) -#rm -f ./script_sql/$sqlscript_name-build.sql -rm -f ./$sqlscript_name-build.sql +rm -f ./script_sql/$sqlscript_name-build.sql sudo rm -f ../../tmp/cache/models/* sudo rm -f ../../tmp/cache/persistent/* +#ls -l ./script_sql/ # Faire ca aussi si ca suffit pas... #sudo chmod -R 777 ../../tmp -- libgit2 0.21.2