1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calibreweb_ynh.git synced 2024-09-03 18:16:20 +02:00

Merge pull request #142 from yunohost-bot/delete-log-removal

[autopatch] Do not delete logs on app removal
This commit is contained in:
Mateusz 2024-07-04 22:25:07 +02:00 committed by GitHub
commit 1c0f07201f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 8 deletions

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2 packaging_format = 2
id = "calibreweb" id = "calibreweb"

View file

@ -91,7 +91,6 @@ if [ -z /etc/ImageMagick-6/policy.xml ]; then
--target_file="/etc/ImageMagick-6/policy.xml" --target_file="/etc/ImageMagick-6/policy.xml"
fi fi
# Remove the log files
ynh_script_progression --message="Removing log file..." --weight=1 ynh_script_progression --message="Removing log file..." --weight=1
ynh_secure_remove "$log_file" ynh_secure_remove "$log_file"
ynh_secure_remove "$access_log_file" ynh_secure_remove "$access_log_file"

View file

@ -40,7 +40,7 @@ chmod 740 $install_dir
#Use venv to install pip requirements - Inspired from https://github.com/YunoHost-Apps/pyinventory_ynh/blob/master/scripts/install #Use venv to install pip requirements - Inspired from https://github.com/YunoHost-Apps/pyinventory_ynh/blob/master/scripts/install
ynh_script_progression --message="Reinstalling pip requirements..." --weight=70 ynh_script_progression --message="Reinstalling pip requirements..." --weight=70
# Always recreate everything fresh with current python version # Always recreate everything fresh with current python version
# When reinstalling on a new yunohost, this is required # When reinstalling on a new yunohost, this is required
if [ -d "${install_dir}/venv" ] ; then if [ -d "${install_dir}/venv" ] ; then
ynh_secure_remove "${install_dir}/venv" ynh_secure_remove "${install_dir}/venv"
fi fi
@ -51,13 +51,14 @@ chown -R "$app:" "$install_dir"
#run source in a 'sub shell' #run source in a 'sub shell'
( (
cd "$install_dir"
set +o nounset set +o nounset
source "${install_dir}/venv/bin/activate" source "venv/bin/activate"
set -o nounset set -o nounset
ynh_exec_as $app $install_dir/venv/bin/python3 -m ensurepip ynh_exec_as $app venv/bin/python3 -m ensurepip
ynh_exec_as $app $install_dir/venv/bin/pip3 install --upgrade wheel pip setuptools ynh_exec_as $app venv/bin/pip3 install --upgrade wheel pip setuptools
ynh_exec_as $app $install_dir/venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/requirements.txt" ynh_exec_as $app venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/requirements.txt"
ynh_exec_as $app $install_dir/venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/optional-requirements.txt" ynh_exec_as $app venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/optional-requirements.txt"
) )
#================================================= #=================================================
@ -167,4 +168,3 @@ ynh_script_progression --message="Restoration completed for $app" --last
# WARNING FOR READ ACCESS # WARNING FOR READ ACCESS
#================================================= #=================================================
ynh_print_warn "Please, give required access to $app user to the $calibre_dir folder." ynh_print_warn "Please, give required access to $app user to the $calibre_dir folder."

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
test_format = 1.0 test_format = 1.0
[default] [default]