diff --git a/manifest.json b/manifest.json index 9811956..448588e 100644 --- a/manifest.json +++ b/manifest.json @@ -9,13 +9,13 @@ }, "version": "0.14.0~ynh1", "url": "https://asciimoo.github.io/searx/", - "license": "AGPLv3", + "license": "AGPL-3.0-or-later", "maintainer": { "name": "opi", "email": "opi@zeropi.net" }, "requirements": { - "yunohost": ">= 2.7.2" + "yunohost": ">= 2.7.12" }, "multi_instance": false, "services": [ diff --git a/scripts/backup b/scripts/backup index 96afb05..9c08491 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,13 @@ set -eu # source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/install b/scripts/install index adc65ea..c0e4f50 100644 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,7 @@ ynh_app_setting_set $app is_public $is_public # INSTALL DEPENDENCIES #================================================= -ynh_install_app_dependencies git build-essential libxslt-dev python-dev python-virtualenv virtualenv python-babel zlib1g-dev libffi-dev libssl-dev python-lxml uwsgi uwsgi-plugin-python +ynh_install_app_dependencies git build-essential libxslt-dev python-dev python-virtualenv virtualenv zlib1g-dev libffi-dev libssl-dev uwsgi uwsgi-plugin-python #================================================= # NGINX CONFIGURATION @@ -93,8 +93,17 @@ ynh_setup_source "$final_path" # INSTALL SEARX IN A VIRTUALENV #================================================= -virtualenv --system-site-packages "$final_path" -bash -c "source $final_path/bin/activate && pip install -U setuptools && pip install --requirement $final_path/requirements-ynh.txt" +virtualenv "$final_path" +#run source in a 'sub shell' +( + set +o nounset + source "$final_path/bin/activate" + set -o nounset + pip install --upgrade pip + pip install --upgrade setuptools + pip install --requirement "$final_path/requirements-ynh.txt" + pip install lxml babel +) #================================================= # CONFIGURE SEARX diff --git a/scripts/restore b/scripts/restore index a460b93..495b97e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -21,6 +21,13 @@ fi source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= @@ -59,7 +66,7 @@ ynh_restore_file "$final_path" # INSTALL DEPENDENCIES #================================================= -ynh_install_app_dependencies libxslt-dev virtualenv python-babel zlib1g-dev libffi-dev libssl-dev python-lxml uwsgi uwsgi-plugin-python +ynh_install_app_dependencies git build-essential libxslt-dev python-dev python-virtualenv virtualenv zlib1g-dev libffi-dev libssl-dev uwsgi uwsgi-plugin-python #================================================= # RECREATE OF THE DEDICATED USER diff --git a/scripts/upgrade b/scripts/upgrade index 59ac2de..831edc4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,6 +58,12 @@ path_url=$(ynh_normalize_url_path $path_url) #================================================= # STANDARD UPGRADE STEPS +#================================================= +# INSTALL DEPENDENCIES +#================================================= + +ynh_install_app_dependencies git build-essential libxslt-dev python-dev python-virtualenv virtualenv zlib1g-dev libffi-dev libssl-dev uwsgi uwsgi-plugin-python + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -96,9 +102,16 @@ ynh_system_user_create $app # UPGRADE SEARX IN ITS VIRTUALENV #================================================= -rm -r $final_path/lib/python2.7/site-packages/setuptools $final_path/lib/python2.7/site-packages/setuptools-* -virtualenv --system-site-packages "$final_path" -bash -c "source $final_path/bin/activate && pip install -U setuptools && pip install --requirement $final_path/requirements-ynh.txt --upgrade" +#run source in a 'sub shell' +( + set +o nounset + source "$final_path/bin/activate" + set -o nounset + pip install --upgrade pip + pip install --upgrade setuptools + pip install --requirement "$final_path/requirements-ynh.txt" + pip install lxml babel +) #================================================= # CONFIGURE SEARX