From 4d27c233445ccb784a44d8d6ad9b1c2c8296658b Mon Sep 17 00:00:00 2001 From: Krakinou Date: Tue, 28 Feb 2023 23:36:30 +0100 Subject: [PATCH] convert v2 --- manifest.toml | 1 - scripts/restore | 12 ++++++------ scripts/upgrade | 4 ++-- tests.toml | 7 ++++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9968ea5..cab1481 100644 --- a/manifest.toml +++ b/manifest.toml @@ -54,7 +54,6 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] - dir = /opt/yunohost/__APP__ [resources.permissions] main.url = "/" diff --git a/scripts/restore b/scripts/restore index d69ce61..8c328ea 100755 --- a/scripts/restore +++ b/scripts/restore @@ -13,8 +13,8 @@ source /usr/share/yunohost/helpers #Have to reload them as otherwise they are all the same backup_OS=$(ynh_app_setting_get --app="$app" --key=OS) backup_mach=$(ynh_app_setting_get --app="$app" --key=mach) -os=`lowercase \`uname -s\`` -mach=`uname -m` +current_os=`lowercase \`uname -s\`` +current_mach=`uname -m` #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -22,10 +22,10 @@ mach=`uname -m` #As we are downloading compiled binaries for each system, we have to check if the restore occurs #on the same system type. If we are restoring on another system type it won't work and in that #case we must go through a reinstall process. -test "$backup_OS" = "$os" \ - || ynh_die --message="Cannot restore : previous OS is $backup_OS, current OS is $OS, please reinstall" -test "$backup_mach" = "$mach" \ - || ynh_die --message="Cannot restore : previous machine type is $backup_mach, current machine type is $MACH, please reinstall" +test "$backup_OS" = "$current_os" \ + || ynh_die --message="Cannot restore : previous OS is $backup_OS, current OS is $current_os, please reinstall" +test "$backup_mach" = "$current_mach" \ + || ynh_die --message="Cannot restore : previous machine type is $backup_mach, current machine type is $current_mach, please reinstall" #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index a2ac64b..493d611 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,8 +13,8 @@ version_gt() { source _common.sh source /usr/share/yunohost/helpers -#REMOVEME? current_OS=$(ynh_app_setting_get --app="$app" --key=OS) -#REMOVEME? current_mach=$(ynh_app_setting_get --app="$app" --key=mach) +current_OS=$(ynh_app_setting_get --app="$app" --key=OS) +current_mach=$(ynh_app_setting_get --app="$app" --key=mach) #================================================= # CHECK VERSION diff --git a/tests.toml b/tests.toml index 5b97434..eeb2be1 100644 --- a/tests.toml +++ b/tests.toml @@ -19,6 +19,8 @@ test_format = 1.0 args.mqtt_domain="mqtt.domain.tld" + exclude = ["package_linter"] + test_upgrade_from.27311ad.name = "2022.2 with mosquitto" test_upgrade_from.27311ad.args.mqtt_domain="mqtt.domain.tld" @@ -33,6 +35,9 @@ test_format = 1.0 set -euxo pipefail yunohost app setting domoticz mqtt_domain -v mqtt.domain.tld """ - exclude = ["install.private", "install.multi", "backup", "change_url"] + args.mqtt_domain="mqtt.domain.tld" + + exclude = ["package_linter", "install.private", "install.multi", "backup_restore", "change_url"] + test_upgrade_from.27311ad.name = "2022.2 without mosquitto" test_upgrade_from.27311ad.args.mqtt_domain="sub.domain.tld" \ No newline at end of file