From 6f812bb0412d095c14aeb50fbdb3005c3b8fa360 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 10 Mar 2021 22:41:06 +0100 Subject: [PATCH 01/12] Upgrade to 5.4.0 --- README.md | 4 ++-- README_fr.md | 6 +++--- conf/app.src | 6 +++--- manifest.json | 2 +- pull_request_template.md | 4 +--- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1d20b8b..96cd2bb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don’t have YunoHost, please see [here](https://yunohost.org/#/install) ## Overview Minetest is a free open-source voxel game engine with easy modding and game creation. -**Shipped version:** 5.3.0 +**Shipped version:** 5.4.0 ## Screenshots @@ -28,7 +28,7 @@ How to configure this app: by SSH ## Documentation * Official documentation: https://wiki.minetest.net/ - * YunoHost documentation: https://yunohost.org/#/app_minetest + * YunoHost documentation: https://yunohost.org/en/app_minetest ## YunoHost specific features diff --git a/README_fr.md b/README_fr.md index 55b3ba1..4177340 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # Minetest for YunoHost [![Niveau d’intégration](https://dash.yunohost.org/integration/minetest.svg)](https://dash.yunohost.org/appci/app/minetest) ![](https://ci-apps.yunohost.org/ci/badges/minetest.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/minetest.maintain.svg) -[![Installer Minetest avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=minetest) +[![Installer Minetest avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=minetest) *[Read this readme in English.](./README.md)* @@ -11,7 +11,7 @@ Si vous n’avez pas YunoHost, veuillez consulter [ici](https://yunohost.org/#/i ## Aperçu Minetest est un moteur de jeu voxel open-source avec modding et création de jeux faciles. -**Version incluse:** 5.3.0 +**Version incluse:** 5.4.0 ## Captures d’écran @@ -28,7 +28,7 @@ Comment configurer cette application : par SSH ## Documentation * Documentation officielle : https://wiki.minetest.net/ - * Documentation YunoHost : https://yunohost.org/#/app_minetest_fr + * Documentation YunoHost : https://yunohost.org/fr/app_minetest ## Caractéristiques spécifiques YunoHost diff --git a/conf/app.src b/conf/app.src index 8daf880..229030c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/minetest/minetest/archive/5.3.0.tar.gz -SOURCE_SUM=65dc2049f24c93fa544500f310a61e289c1b8fa47bf60877b746a2c27a7238d6 +SOURCE_URL=https://github.com/minetest/minetest/archive/5.4.0.tar.gz +SOURCE_SUM=6e9b299e156651be9bcf973a9232cff32215de31dfae5ea770a71d1757cab014 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=minetest-5.3.0.tar.gz +SOURCE_FILENAME=minetest-5.4.0.tar.gz diff --git a/manifest.json b/manifest.json index 8951e91..f4526ba 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Free, open source voxel game engine and game. Need a client to connect to the server.", "fr": "Moteur de jeu de type « bac à sable » gratuit et open source. Nécessite un client pour se connecter au serveur." }, - "version": "5.3.0~ynh1", + "version": "5.4.0~ynh1", "url": "http://www.minetest.net/", "license": "MIT", "maintainer": { diff --git a/pull_request_template.md b/pull_request_template.md index b67f687..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/minetest_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/minetest_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* From 6a5c7fc8d67249a90919461ab58a4e2c5c8a143a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 11:00:43 +0100 Subject: [PATCH 02/12] Update minetest_game.src --- conf/minetest_game.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/minetest_game.src b/conf/minetest_game.src index d6b33b3..95ca5fa 100644 --- a/conf/minetest_game.src +++ b/conf/minetest_game.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.3.0.tar.gz -SOURCE_SUM=06c6c1d4b97af211dd0fa518a3e68a205f594e9816a4b2477e48d4d21d278e2d +SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.4.0.tar.gz +SOURCE_SUM=520d2056085ec11e8806cf5a8f928537797d27a86704770bf408c113ea9881cb SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=minetest_game-5.3.0.tar.gz +SOURCE_FILENAME=minetest_game-5.4.0.tar.gz From ff5d43556a5439548735b581b997e722d7699fb9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 17 Apr 2021 19:28:58 +0200 Subject: [PATCH 03/12] Attempt to fix tests... --- check_process | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/check_process b/check_process index d1f6fdb..de2ee7d 100644 --- a/check_process +++ b/check_process @@ -5,10 +5,10 @@ ;; Test complet minetest_game ; Manifest - domain="domain.tld" (DOMAIN) + server_domain="domain.tld" (DOMAIN) pvp=1 servername="packagecheck" - game="minetest_game" + game="minetest_game" creative=0 damage=1 is_public=0 (PUBLIC|public=1|private=0) @@ -30,10 +30,10 @@ ;; Test complet capturetheflag ; Manifest - domain="domain.tld" (DOMAIN) + server_domain="domain.tld" (DOMAIN) pvp=1 servername="packagecheck" - game="capturetheflag" + game="capturetheflag" creative=0 damage=1 is_public=0 (PUBLIC|public=1|private=0) @@ -52,6 +52,3 @@ incorrect_path=0 port_already_use=1 change_url=0 -;;; Options -Email= -Notification=none From 5b582b17d872c531eeaed48b1e6e3ce795ed4c67 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 17 Apr 2021 19:43:46 +0200 Subject: [PATCH 04/12] server_domain -> domain --- README.md | 4 ++-- README_fr.md | 4 ++-- conf/systemd.service | 4 +++- manifest.json | 2 +- scripts/install | 10 +++++----- scripts/restore | 2 +- scripts/upgrade | 22 +++++++++++----------- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 96cd2bb..ee1a2c8 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ How to configure this app: by SSH #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 4177340..393467f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,8 +39,8 @@ Comment configurer cette application : par SSH ##### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/) ## Limitations diff --git a/conf/systemd.service b/conf/systemd.service index c9e53e2..8bb9f42 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,10 +3,12 @@ Description=Minetest multiplayer server minetest.conf server config Documentation=man:minetestserver(6) After=network.target RequiresMountsFor=/home/yunohost.app/__APP__ + [Service] Restart=on-failure User=__APP__ Group=__APP__ -ExecStart=__FINALPATH__/bin/minetestserver --config /home/yunohost.app/__APP__/.minetest/minetest.conf --logfile /var/log/__APP__/minetest.log +ExecStart=__FINALPATH__/bin/minetestserver --config /home/yunohost.app/__APP__/.minetest/minetest.conf --logfile /var/log/__APP__/__APP__.log + [Install] WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index f4526ba..bb47013 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,7 @@ "arguments": { "install" : [ { - "name": "server_domain", + "name": "domain", "type": "domain", "ask": { "en": "Choose a domain for your Minetest server", diff --git a/scripts/install b/scripts/install index 0f2c388..305ee57 100755 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -server_domain=$YNH_APP_ARG_SERVER_DOMAIN +domain=$YNH_APP_ARG_DOMAIN is_public=$YNH_APP_ARG_IS_PUBLIC game=$YNH_APP_ARG_GAME pvp=$YNH_APP_ARG_PVP @@ -48,7 +48,7 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" #================================================= ynh_script_progression --message="Storing installation settings..." -ynh_app_setting_set --app=$app --key=server_domain --value=$server_domain +ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=game --value=$game ynh_app_setting_set --app=$app --key=is_public --value=$is_public @@ -62,7 +62,7 @@ ynh_app_setting_set --app=$app --key=servername --value=$servername #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find a free port port=$(ynh_find_port 30000) @@ -143,7 +143,7 @@ ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_f ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$server_domain" --target_file="$home_path/.minetest/minetest.conf" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__ANNOUNCE__" --replace_string="$is_public" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf" @@ -192,7 +192,7 @@ yunohost service add $app --description="Voxel game engine and game" --log="/var #================================================= # RELOAD MINETEST #================================================= -ynh_print_info --message="Reloading minetest..." +ynh_print_info --message="Reloading Minetest..." ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/minetest.log" --line_match="listening on" diff --git a/scripts/restore b/scripts/restore index 50123d7..686b6b4 100755 --- a/scripts/restore +++ b/scripts/restore @@ -106,7 +106,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Reloading minetest..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/minetest.log" --line_match="listening on" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="listening on" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 61d0887..be74a02 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,7 +16,7 @@ ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME -server_domain=$(ynh_app_setting_get --app=$app --key=server_domain) +domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) game=$(ynh_app_setting_get --app=$app --key=game) is_public=$(ynh_app_setting_get --app=$app --key=is_public) @@ -31,6 +31,7 @@ servername=$(ynh_app_setting_get --app=$app --key=servername) # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Checking version..." + version=ynh_app_upstream_version if [ "$version" = "0.01" ]; then @@ -40,14 +41,6 @@ fi ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi # If final_path doesn't exist, create it if [ -z $final_path ]; then @@ -55,6 +48,13 @@ if [ -z $final_path ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -155,7 +155,7 @@ ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_f ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$server_domain" --target_file="$home_path/.minetest/minetest.conf" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__ANNOUNCE__" --replace_string="$is_public" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf" @@ -192,7 +192,7 @@ yunohost service add $app --description="Voxel game engine and game" --log="/var #================================================= ynh_script_progression --message="Restarting Minetest..." -ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/minetest.log" --line_match="listening on" +ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/$app.log" --line_match="listening on" #================================================= # END OF SCRIPT From 6f7dca362a884baa30fa28ea58c3793caf82bec5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 17 Apr 2021 19:50:44 +0200 Subject: [PATCH 05/12] Upgrade to version 5.4.1 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 6 +++--- conf/minetest_game.src | 6 +++--- manifest.json | 12 ++---------- scripts/upgrade | 18 +++++++++++++----- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index ee1a2c8..3eef276 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don’t have YunoHost, please see [here](https://yunohost.org/#/install) ## Overview Minetest is a free open-source voxel game engine with easy modding and game creation. -**Shipped version:** 5.4.0 +**Shipped version:** 5.4.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 393467f..07c7f4a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n’avez pas YunoHost, veuillez consulter [ici](https://yunohost.org/#/i ## Aperçu Minetest est un moteur de jeu voxel open-source avec modding et création de jeux faciles. -**Version incluse:** 5.4.0 +**Version incluse:** 5.4.1 ## Captures d’écran diff --git a/conf/app.src b/conf/app.src index 229030c..1957d04 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/minetest/minetest/archive/5.4.0.tar.gz -SOURCE_SUM=6e9b299e156651be9bcf973a9232cff32215de31dfae5ea770a71d1757cab014 +SOURCE_URL=https://github.com/minetest/minetest/archive/5.4.1.tar.gz +SOURCE_SUM=de9e4410583c845c104b4be25f9d0b8743d8573c120149b8910ae2519f9ab14e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=minetest-5.4.0.tar.gz +SOURCE_FILENAME=minetest-5.4.1.tar.gz diff --git a/conf/minetest_game.src b/conf/minetest_game.src index 95ca5fa..7213f4d 100644 --- a/conf/minetest_game.src +++ b/conf/minetest_game.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.4.0.tar.gz -SOURCE_SUM=520d2056085ec11e8806cf5a8f928537797d27a86704770bf408c113ea9881cb +SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.4.1.tar.gz +SOURCE_SUM=b4bfa0755b88230cf4bdb6af6a0951dd1248f6cdf87fecc340e43ac12c80b0b2 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=minetest_game-5.4.0.tar.gz +SOURCE_FILENAME=minetest_game-5.4.1.tar.gz diff --git a/manifest.json b/manifest.json index bb47013..4907835 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Free, open source voxel game engine and game. Need a client to connect to the server.", "fr": "Moteur de jeu de type « bac à sable » gratuit et open source. Nécessite un client pour se connecter au serveur." }, - "version": "5.4.0~ynh1", + "version": "5.4.1~ynh1", "url": "http://www.minetest.net/", "license": "MIT", "maintainer": { @@ -20,7 +20,7 @@ "url": "https://framasoft.org" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -31,19 +31,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for your Minetest server", - "fr": "Choisissez un domaine pour votre serveur Minetest" - }, "example": "domain.org" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public server? (should we announce it?)", - "fr": "Est-ce un serveur public ? (devons-nous l'annoncer ?)" - }, "default": false }, { diff --git a/scripts/upgrade b/scripts/upgrade index be74a02..2e48e65 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,13 +19,13 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) game=$(ynh_app_setting_get --app=$app --key=game) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) home_path=$(ynh_app_setting_get --app=$app --key=home_path) pvp=$(ynh_app_setting_get --app=$app --key=pvp) creative=$(ynh_app_setting_get --app=$app --key=creative) damage=$(ynh_app_setting_get --app=$app --key=damage) servername=$(ynh_app_setting_get --app=$app --key=servername) +is_public=$(ynh_app_setting_get --app=$app --key=is_public) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -38,10 +38,8 @@ if [ "$version" = "0.01" ]; then ynh_die --message="You can't upgrade to this version with simple upgrade. Please read the readme for upgrading https://github.com/YunoHost-Apps/minetest_ynh#additional-information ..." fi - ynh_script_progression --message="Ensuring downward compatibility..." - # If final_path doesn't exist, create it if [ -z $final_path ]; then final_path=/opt/yunohost/$app @@ -78,8 +76,18 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Upgrading source files..." -# Remove old install -ynh_secure_remove --file="$final_path" +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --time --weight=1 + + # Remove old install + ynh_secure_remove --file="$final_path" + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" +fi + + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" From 56e1128f880afcfd4083bda02cccffe5428427fa Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 17 Apr 2021 19:56:32 +0200 Subject: [PATCH 06/12] Add_config --- scripts/install | 17 ++++++++--------- scripts/upgrade | 37 ++++++++++++------------------------- 2 files changed, 20 insertions(+), 34 deletions(-) diff --git a/scripts/install b/scripts/install index 305ee57..53b6e92 100755 --- a/scripts/install +++ b/scripts/install @@ -138,16 +138,15 @@ popd ### `ynh_replace_string` is used to replace a string in a file. ### (It's compatible with sed regular expressions syntax) +# Install the game -ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__ANNOUNCE__" --replace_string="$is_public" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf" +if [ $is_public = 1 ]; then + annouce = "true" +else + annouce = "fase" +fi + +ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" #================================================= # CREATE WORLD diff --git a/scripts/upgrade b/scripts/upgrade index 2e48e65..2edb845 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,7 +78,7 @@ ynh_script_progression --message="Upgrading source files..." if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --time --weight=1 + ynh_script_progression --message="Upgrading source files..." --weight=1 # Remove old install ynh_secure_remove --file="$final_path" @@ -87,11 +87,6 @@ then ynh_setup_source --dest_dir="$final_path" fi - - -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -120,11 +115,11 @@ ynh_add_systemd_config #================================================= if [ -e $home_path ] -then -echo "Nothing to do..." -else -mkdir -p $home_path/.minetest/ -mkdir $home_path/.minetest/worlds/ + then + echo "Nothing to do..." + else + mkdir -p $home_path/.minetest/ + mkdir $home_path/.minetest/worlds/ fi #================================================= @@ -155,21 +150,13 @@ popd # MODIFY A CONFIG FILE #================================================= -ynh_backup_if_checksum_is_different --file="$home_path/.minetest/minetest.conf" +if [ $is_public = 1 ]; then + annouce = "true" +else + annouce = "fase" +fi -cp ../conf/minetest.conf $home_path/.minetest/minetest.conf - -ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__ANNOUNCE__" --replace_string="$is_public" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf" -ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf" - -ynh_store_file_checksum --file="$home_path/.minetest/minetest.conf" +ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" #================================================= # SETUP LOGROTATE From 09d09cc330d18612472984c655b3a9047bc8da92 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 17 Apr 2021 19:59:10 +0200 Subject: [PATCH 07/12] Fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 53b6e92..2647cef 100755 --- a/scripts/install +++ b/scripts/install @@ -140,7 +140,7 @@ popd ### (It's compatible with sed regular expressions syntax) # Install the game -if [ $is_public = 1 ]; then +if [ $is_public -eq 1 ]; then annouce = "true" else annouce = "fase" diff --git a/scripts/upgrade b/scripts/upgrade index 2edb845..9d55989 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -150,7 +150,7 @@ popd # MODIFY A CONFIG FILE #================================================= -if [ $is_public = 1 ]; then +if [ $is_public -eq 1 ]; then annouce = "true" else annouce = "fase" From c6ccec4cda628014461afb1687723a57e6ffb8ba Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Apr 2021 07:45:09 +0200 Subject: [PATCH 08/12] Fix --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 2647cef..397b246 100755 --- a/scripts/install +++ b/scripts/install @@ -141,9 +141,9 @@ popd # Install the game if [ $is_public -eq 1 ]; then - annouce = "true" + announce="true" else - annouce = "fase" + announce="fase" fi ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 9d55989..cf242a2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,9 +151,9 @@ popd #================================================= if [ $is_public -eq 1 ]; then - annouce = "true" + announce="true" else - annouce = "fase" + announce="fase" fi ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" From 7c7b18a6667390572ad2eaa6cb2d808de5a7429a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Apr 2021 11:10:22 +0200 Subject: [PATCH 09/12] Update check_process --- check_process | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index de2ee7d..d4f8799 100644 --- a/check_process +++ b/check_process @@ -5,10 +5,10 @@ ;; Test complet minetest_game ; Manifest - server_domain="domain.tld" (DOMAIN) + domain="domain.tld" (DOMAIN) pvp=1 servername="packagecheck" - game="minetest_game" + game="minetest_game" creative=0 damage=1 is_public=0 (PUBLIC|public=1|private=0) @@ -30,10 +30,10 @@ ;; Test complet capturetheflag ; Manifest - server_domain="domain.tld" (DOMAIN) + domain="domain.tld" (DOMAIN) pvp=1 servername="packagecheck" - game="capturetheflag" + game="capturetheflag" creative=0 damage=1 is_public=0 (PUBLIC|public=1|private=0) From 59ce175497c17bb4ebe4ce6db3f4545238d9d293 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Apr 2021 11:14:11 +0200 Subject: [PATCH 10/12] Update upgrade --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index cf242a2..10a3fd9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,6 +46,12 @@ if [ -z $final_path ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# If domain doesn't exist, create it +if [ -z "$domain" ]; then + domain=$server_domain + ynh_app_setting_set --app=$app --key=domain --value=$domain +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all From 8c9b9f591f66f78375b5d90b9484817abe8e91f1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Apr 2021 12:07:00 +0200 Subject: [PATCH 11/12] Update upgrade --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 10a3fd9..9856b38 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,12 @@ damage=$(ynh_app_setting_get --app=$app --key=damage) servername=$(ynh_app_setting_get --app=$app --key=servername) is_public=$(ynh_app_setting_get --app=$app --key=is_public) +#================================================= +# CHECK VERSION +#================================================= + +upgrade_type=$(ynh_check_app_version_changed) + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= From 43516df97cde9ab7a2e0f1871ce993745732fb90 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Apr 2021 17:29:04 +0200 Subject: [PATCH 12/12] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9856b38..bba5fe3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,7 @@ fi # If domain doesn't exist, create it if [ -z "$domain" ]; then - domain=$server_domain + domain=$(ynh_app_setting_get --app=$app --key=server_domain) ynh_app_setting_set --app=$app --key=domain --value=$domain fi