From f3ada8be24aee6052b1b38a251951ad745b08335 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 11 Jun 2024 21:23:30 +0200 Subject: [PATCH] Fux move to ynh autoupdater --- manifest.toml | 2 +- scripts/install | 7 ++++++- scripts/upgrade | 7 ++++++- tests.toml | 5 ----- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/manifest.toml b/manifest.toml index a15be7e..71a5215 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ userdoc = "https://docs.searxng.org/user/" code = "https://github.com/searxng/searxng" [integration] -yunohost = ">= 11.1.9" +yunohost = ">= 11.2.14.1" architectures = "all" multi_instance = false ldap = "not_relevant" diff --git a/scripts/install b/scripts/install index 3f6664d..a16a5e3 100755 --- a/scripts/install +++ b/scripts/install @@ -16,7 +16,12 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_setup_source --dest_dir="$install_dir/searxng-src" +repo_fullpath=$(ynh_read_manifest --manifest_key="upstream.code") +commit_sha=$(ynh_read_manifest --manifest_key="resources.sources.main.url" | xargs basename | tr -d"." -f1) +ynh_exec_fully_quiet git clone -n "$repo_fullpath" "$install_dir/searxng-src" +pushd "$install_dir/searxng-src" + ynh_exec_fully_quiet git checkout "$commit_sha" +popd ynh_script_progression --message="Installing SearXNG..." --weight=2 diff --git a/scripts/upgrade b/scripts/upgrade index a9887d3..96c7be0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,12 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_secure_remove --file="$install_dir/searxng-src" - ynh_setup_source --dest_dir="$install_dir/searxng-src" + repo_fullpath=$(ynh_read_manifest --manifest_key="upstream.code") + commit_sha=$(ynh_read_manifest --manifest_key="resources.sources.main.url" | xargs basename | tr -d"." -f1) + ynh_exec_fully_quiet git clone -n "$repo_fullpath" "$install_dir/searxng-src" + pushd "$install_dir/searxng-src" + ynh_exec_fully_quiet git checkout "$commit_sha" + popd ynh_secure_remove --file="$install_dir/searxng-pyenv" python3 -m venv --system-site-packages "$install_dir/searxng-pyenv" diff --git a/tests.toml b/tests.toml index 81dc0a3..be5955f 100644 --- a/tests.toml +++ b/tests.toml @@ -15,8 +15,3 @@ test_format = 1.0 # ------------------------------- # Commits to test upgrade from # ------------------------------- - test_upgrade_from.9de9cc90.name = "2023.09.17.22.15.57~ynh1 / packaging v1" - test_upgrade_from.9de9cc90.args.domain = "domain.tld" - test_upgrade_from.9de9cc90.args.path = "/path" - test_upgrade_from.9de9cc90.args.is_public = 1 - test_upgrade_from.9de9cc90.args.admin = "john"