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

Refrcator
Some checks failed
YunoHost apps package linter / test (push) Has been cancelled

This commit is contained in:
Sylvain 2024-07-22 09:49:19 +02:00
parent 69c087cf29
commit 3e77a1aa8f
2 changed files with 3 additions and 38 deletions

View file

@ -16,10 +16,7 @@ myynh_source_searxng () {
# Download source # Download source
sudo -H -u $app -i bash << EOF sudo -H -u $app -i bash << EOF
if [ ! -d "$install_dir/searxng-src" ] mkdir "$install_dir/searxng-src"
then
mkdir "$install_dir/searxng-src"
fi
git clone -n "$repo_fullpath" "$install_dir/searxng-src" 2>&1 git clone -n "$repo_fullpath" "$install_dir/searxng-src" 2>&1
EOF EOF
@ -54,39 +51,6 @@ pip install -e .
EOF EOF
} }
# Upgrade the virtual environment directory
myynh_upgrade_venv_directory () {
# Remove old python links before recreating them
if [ -d "$install_dir/searxng-pyenv/bin/" ]
then
find "$install_dir/searxng-pyenv/bin/" \
-type l -name 'python*' \
-exec bash -c 'rm --force "$1"' _ {} \;
fi
# Remove old python directories before recreating them
if [ -d "$install_dir/searxng-pyenv/lib/" ]
then
find "$install_dir/searxng-pyenv/lib/" \
-mindepth 1 -maxdepth 1 -type d -name "python*" \
-not -path "*/python*" \
-exec bash -c 'rm --force --recursive "$1"' _ {} \;
fi
if [ -d "$install_dir/searxng-pyenv/include/site/" ]
then
find "$install_dir/searxng-pyenv/include/site/" \
-mindepth 1 -maxdepth 1 -type d -name "python*" \
-not -path "*/python*" \
-exec bash -c 'rm --force --recursive "$1"' _ {} \;
fi
# Upgrade the virtual environment directory
sudo -H -u $app -i bash << EOF
python3 -m venv --upgrade "$install_dir/searxng-pyenv"
EOF
}
# Set permissions # Set permissions
myynh_set_permissions () { myynh_set_permissions () {
chown -R $app: "$install_dir" chown -R $app: "$install_dir"

View file

@ -46,7 +46,8 @@ ynh_systemd_action --service_name="uwsgi-app@$app.service" --action="stop" --log
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
myynh_upgrade_venv_directory ynh_secure_remove --file="$install_dir/searxng-src"
ynh_secure_remove --file="$install_dir/searxng-pyenv"
myynh_source_searxng myynh_source_searxng
myynh_install_searxng myynh_install_searxng
fi fi