From 7a69b41542d5ed76f035a86325d73122c70a03a8 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 5 Aug 2023 12:44:13 +0200 Subject: [PATCH] patch web.py --- scripts/install | 4 +++- scripts/upgrade | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 71428ad..d1f349e 100755 --- a/scripts/install +++ b/scripts/install @@ -37,7 +37,9 @@ ynh_add_config --template="../sources/patches/main-constants.py.patch.src" --des ynh_setup_source --dest_dir="$install_dir" # Remove the patch for web.py in case visitor are allowed -patch -u /$install_dir/cps/web.py -i ../conf/web.py.revert.patch +if [ $(ynh_permission_has_user --permission=main --user=visitors) ]; then + patch -u /$install_dir/cps/web.py -i ../conf/web.py.revert.patch +fi #install kepubify converter ynh_script_progression --message="Installing kepubify..." --weight=1 diff --git a/scripts/upgrade b/scripts/upgrade index 13a6aa6..eb88a01 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -96,6 +96,12 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" chown -R $app: $install_dir + + # Remove the patch for web.py in case visitor are allowed + if [ $(ynh_permission_has_user --permission=main --user=visitors) ]; then + patch -u /$install_dir/cps/web.py -i ../conf/web.py.revert.patch + fi + fi #=================================================