From addae4124eac424e61d5a080bc65044b016134eb Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 12 May 2023 20:38:15 +0200 Subject: [PATCH] Fix regular vs. LTS source usage logic, and switch to new sources format --- conf/app.src | 18 ------------------ manifest.toml | 23 +++++++++++++++++------ scripts/install | 8 +++++++- scripts/upgrade | 8 +++++++- 4 files changed, 31 insertions(+), 26 deletions(-) delete mode 100644 conf/app.src diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 3443bab..0000000 --- a/conf/app.src +++ /dev/null @@ -1,18 +0,0 @@ -if [ "$release_cycle" == "regular" ]; -then -SOURCE_URL=https://sourceforge.net/projects/tikiwiki/files/Tiki_25.x_Sagittarius_A/25.0/tiki-25.0.tar.gz/download -SOURCE_SUM=e056cdcfdcb03a8c4710db44e7f04e0f846eb7131a8f8aa130a3d8348e0161a4 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true -else -SOURCE_URL=https://sourceforge.net/projects/tikiwiki/files/Tiki_25.x_Sagittarius_A/25.0/tiki-25.0.tar.gz/download -SOURCE_SUM=e056cdcfdcb03a8c4710db44e7f04e0f846eb7131a8f8aa130a3d8348e0161a4 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true -fi diff --git a/manifest.toml b/manifest.toml index 403403e..334fdb0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -34,13 +34,13 @@ ram.runtime = "50M" default = "/tiki" [install.release_cycle] - ask.en = "Upgrade cycle" - ask.fr = "Cycle de mises à jours" - help.en = "Every 3 version is an LTS. LTS versions are supported for 4 years" - help.fr = "Toutes les 3 versions sont des LTS qui sont maintenues pendant 4 ans" + ask.en = "Upgrade cycle" + ask.fr = "Cycle de mises à jours" + help.en = "Every 3 version is an LTS. LTS versions are supported for 4 years" + help.fr = "Toutes les 3 versions sont des LTS qui sont maintenues pendant 4 ans" type = "select" - choices.longterm = "Install latest Long Term Support version" - choices.regular = "Install latest version" + choices.longterm = "Install latest Long Term Support version (recommended)" + choices.regular = "Install latest version" default = "longterm" [install.init_main_permission] @@ -48,6 +48,17 @@ ram.runtime = "50M" default = "visitors" [resources] + + [resources.sources] + + [resources.sources.main] + url = "https://sourceforge.net/projects/tikiwiki/files/Tiki_25.x_Sagittarius_A/25.0/tiki-25.0.tar.gz/download" + sha256 = "e056cdcfdcb03a8c4710db44e7f04e0f846eb7131a8f8aa130a3d8348e0161a4" + + [resources.sources.lts] + url = "https://sourceforge.net/projects/tikiwiki/files/Tiki_25.x_Sagittarius_A/25.0/tiki-25.0.tar.gz/download" + sha256 = "e056cdcfdcb03a8c4710db44e7f04e0f846eb7131a8f8aa130a3d8348e0161a4" + [resources.system_user] [resources.install_dir] diff --git a/scripts/install b/scripts/install index 0f968ca..00d46ec 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,13 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_script_progression --message="Setting up source files..." --weight=15 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" +source_id_to_use="main" +if [[ "$release_cycle" != "longterm" ]] +then + source_id_to_use="lts" +fi + +ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 1088450..75e8151 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,7 +47,13 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + source_id_to_use="main" + if [[ "$release_cycle" != "longterm" ]] + then + source_id_to_use="lts" + fi + + ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use" fi chmod -R o-rwx "$install_dir"