From fedc22a80b04d109ab777167dcc7a12a1dc3eeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 29 Jul 2020 22:48:16 +0200 Subject: [PATCH] Fix issues on upgrade of major debian version --- scripts/_common.sh | 7 +++++++ scripts/restore | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 1c90902..e095f0b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -26,6 +26,13 @@ setup_dir() { } install_source() { + # Clean venv is it was on python with an old version in case major upgrade of debian + if [ ! -e $final_path/lib/python$python_version ]; then + ynh_secure_remove --file=$final_path + fi + + mkdir -p $final_path + if [ -n "$(uname -m | grep arm)" ] then # Clean old file, sometime it could make some big issues if we don't do this !! diff --git a/scripts/restore b/scripts/restore index 0f5d7ad..801dd92 100644 --- a/scripts/restore +++ b/scripts/restore @@ -40,6 +40,10 @@ ynh_system_user_create --username $pgadmin_user --home_dir /var/lib/$app ynh_script_progression --message="Restoring files..." --weight=5 ynh_restore +# Check that the good python version is installed +# If not upgrade the source +install_sources + # POPULATE THE DATABASE ynh_script_progression --message="Reconfiguring Postgresql database..." ynh_psql_test_if_first_run