From 5ea06ca8981d8cdc3a434531800da127042be912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 14 Jul 2024 15:00:29 +0200 Subject: [PATCH] Try to fix upgrade --- scripts/_common.sh | 10 +++------- scripts/install | 2 -- scripts/upgrade | 24 ++++++++++++++++-------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 0d53169..5691977 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,13 +10,6 @@ nodejs_version=16 # PERSONAL HELPERS #================================================= -_ynh_caerp_patch_src() { - # Patching requirements.txt to use system provided Cython - cython_version=$(cython3 --version 2>&1 | sed 's|Cython version ||') - sed -i "s|Cython=.*|Cython==$cython_version|" "$install_dir/caerp/requirements.txt" -} - - _ynh_caerp_build_ui() { ynh_use_nodejs @@ -34,6 +27,9 @@ _ynh_caerp_build_python() { python_venv_site_packages=$(_ynh_python_venv_get_site_packages_dir -d "$install_dir/venv") pushd "$install_dir/caerp" 2>&1 + # Might be a fix for `AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'` + ynh_exec_as "$app" "$install_dir/venv/bin/python3" -m pip uninstall cryptography + ynh_exec_as "$app" "$install_dir/venv/bin/python3" -m pip install -r requirements.txt ynh_exec_as "$app" "$install_dir/venv/bin/python3" ./setup.py install 2>&1 popd 2>&1 diff --git a/scripts/install b/scripts/install index 7815aad..c51f35a 100755 --- a/scripts/install +++ b/scripts/install @@ -32,8 +32,6 @@ ynh_setup_source --dest_dir="$install_dir/caerp" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" -# _ynh_caerp_patch_src - #================================================= # SETUP APPLICATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index cb059e5..81ed8b9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -37,6 +37,14 @@ ynh_script_progression --message="Updating NodeJS..." --weight=1 ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version" +#================================================= +# ENABLE MANDATORY FRENCH LOCALE +#================================================= +ynh_script_progression --message="Enabling french system locale..." --weight=1 + +sed -i 's|^#\? \?\(fr_FR.UTF-8 \?.*\)$|\1|' /etc/locale.gen +locale-gen + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -48,7 +56,13 @@ ynh_setup_source --dest_dir="$install_dir/caerp" --full_replace --keep="endi.ini chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" -# _ynh_caerp_patch_src +#================================================= +# SETUP APPLICATION +#================================================= +ynh_script_progression --message="Building $app..." --weight=1 + +_ynh_caerp_build_ui +_ynh_caerp_build_python #================================================= # UPDATE A CONFIG FILE @@ -60,17 +74,11 @@ ynh_add_config --template="caerp.ini" --destination="$install_dir/caerp.ini" chmod 500 "$install_dir/caerp.ini" chown "$app:$app" "$install_dir/caerp.ini" -#================================================= -# SETUP APPLICATION -#================================================= -ynh_script_progression --message="Building $app..." --weight=1 -_ynh_caerp_build_ui -_ynh_caerp_build_python - #================================================= # SETUP APPLICATION #================================================= ynh_script_progression --message="Migrating databases..." --weight=1 + _ynh_caerp_migratedb #=================================================