From 8828e1d8e2c61c4950dcb330523281412b03c83f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 3 Mar 2022 01:59:43 +0100 Subject: [PATCH 01/19] Implement install and removal of YunoHost apps --- helpers/app | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 helpers/app diff --git a/helpers/app b/helpers/app new file mode 100644 index 000000000..310d7d25c --- /dev/null +++ b/helpers/app @@ -0,0 +1,92 @@ +#!/bin/bash + +# Install other YunoHost apps +# +# usage: ynh_install_apps --apps="a_ynh b_ynh?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" +# | arg: -a, --apps= - apps to install +# +# Requires YunoHost version *.*.* or higher. +ynh_install_apps() { + # Declare an array to define the options of this helper. + local legacy_args=a + local -A args_array=([a]=apps=) + local apps + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + # Split the list of apps in an array + local apps_list=($(echo $apps | tr " " "\n")) + + # For each app + for i in "${apps_list[@]}" + do + # Retrieve the name of the app (part before _ynh) + local oneapp=$(echo "$i" | awk -F'[_ynh]' '{print $1}') + [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to install" + + # Retrieve the arguments of the app (part after ?) + local oneargument=$(echo "$i" | awk -F'[?]' '{print $2}') + [ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\"" + + if ! yunohost app list | grep -q "$oneapp" + then + yunohost tools update + yunohost app install $oneapp $oneargument + else + yunohost tools update + yunohost app upgrade $oneapp $oneargument + fi + ynh_app_setting_set --app=$app --key=require_$oneapp --value="1" + done +} + +# Remove other YunoHost apps +# +# apps will be removed only if no other apps need them. +# +# usage: ynh_remove_apps --apps="a_ynh b_ynh?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" +# | arg: -a, --apps= - apps to install +# +# Requires YunoHost version *.*.* or higher. +ynh_remove_apps() { + # Declare an array to define the options of this helper. + local legacy_args=a + local -A args_array=([a]=app=) + local app + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + # Split the list of apps in an array + local apps_list=($(echo $apps | tr " " "\n")) + + # For each app + for i in "${apps_list[@]}" + do + # Retrieve the name of the app (part before _ynh) + local oneapp=$(echo "$i" | awk -F'[_ynh]' '{print $1}') + [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to remove" + + ynh_app_setting_delete --app=$app --key=require_$oneapp + + # List apps requiring $oneapp + local installed_apps=$(yunohost app list | grep -oP 'id: \K.*$') + local required_by="" + local installed_app_required_by="" + for installed_app in $installed_apps + do + local installed_app_required_by=$(ynh_app_setting_get --app=$installed_app --key="require_$oneapp") + if [[ $installed_app_required_by ]] + then + required_by="${installed_app_required_by}" + fi + installed_app_required_by="" + done + + # If $oneapp is no more required + if [[ ! $required_by ]] + then + # Remove $oneapp + ynh_print_info --message="Removing of $oneapp" + yunohost app remove $oneapp --purge + done +} \ No newline at end of file From 266e890c46de5c9559a3587eb319abc34333707f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 5 Mar 2022 14:31:02 +0100 Subject: [PATCH 02/19] Update app --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 310d7d25c..f327a4629 100644 --- a/helpers/app +++ b/helpers/app @@ -89,4 +89,4 @@ ynh_remove_apps() { ynh_print_info --message="Removing of $oneapp" yunohost app remove $oneapp --purge done -} \ No newline at end of file +} From 0b17cf754d092e5ca3815005dfe68289299ce9c7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 6 Mar 2022 15:23:05 +0100 Subject: [PATCH 03/19] Update app --- helpers/app | 1 + 1 file changed, 1 insertion(+) diff --git a/helpers/app b/helpers/app index f327a4629..ed5ddcb59 100644 --- a/helpers/app +++ b/helpers/app @@ -88,5 +88,6 @@ ynh_remove_apps() { # Remove $oneapp ynh_print_info --message="Removing of $oneapp" yunohost app remove $oneapp --purge + fi done } From 7e0f280b6941e22a6242046fa96217157ab86050 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 6 Mar 2022 15:32:39 +0100 Subject: [PATCH 04/19] fix awk --- helpers/app | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/app b/helpers/app index ed5ddcb59..35d97851c 100644 --- a/helpers/app +++ b/helpers/app @@ -21,11 +21,11 @@ ynh_install_apps() { for i in "${apps_list[@]}" do # Retrieve the name of the app (part before _ynh) - local oneapp=$(echo "$i" | awk -F'[_ynh]' '{print $1}') + local oneapp=$(echo "$i" | awk -F'_ynh' '{print $1}') [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to install" # Retrieve the arguments of the app (part after ?) - local oneargument=$(echo "$i" | awk -F'[?]' '{print $2}') + local oneargument=$(echo "$i" | awk -F'?' '{print $2}') [ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\"" if ! yunohost app list | grep -q "$oneapp" @@ -63,7 +63,7 @@ ynh_remove_apps() { for i in "${apps_list[@]}" do # Retrieve the name of the app (part before _ynh) - local oneapp=$(echo "$i" | awk -F'[_ynh]' '{print $1}') + local oneapp=$(echo "$i" | awk -F'_ynh' '{print $1}') [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to remove" ynh_app_setting_delete --app=$app --key=require_$oneapp From 756f561ddda1e2ebfccea9a730cd7ba73adec3ca Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 22:45:34 +0100 Subject: [PATCH 05/19] Update helpers/app Co-authored-by: Alexandre Aubin --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 35d97851c..9d183cb2d 100644 --- a/helpers/app +++ b/helpers/app @@ -2,7 +2,7 @@ # Install other YunoHost apps # -# usage: ynh_install_apps --apps="a_ynh b_ynh?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" +# usage: ynh_install_apps --apps="appfoo appbar?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" # | arg: -a, --apps= - apps to install # # Requires YunoHost version *.*.* or higher. From fb53a69dd0a8cd88efb31a1d0f1596ae6446858b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 22:45:42 +0100 Subject: [PATCH 06/19] Update helpers/app Co-authored-by: Alexandre Aubin --- helpers/app | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/app b/helpers/app index 9d183cb2d..8745e2363 100644 --- a/helpers/app +++ b/helpers/app @@ -18,14 +18,14 @@ ynh_install_apps() { local apps_list=($(echo $apps | tr " " "\n")) # For each app - for i in "${apps_list[@]}" + for oneapp_and_its_args in "${apps_list[@]}" do # Retrieve the name of the app (part before _ynh) - local oneapp=$(echo "$i" | awk -F'_ynh' '{print $1}') + local oneapp=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $1}') [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to install" # Retrieve the arguments of the app (part after ?) - local oneargument=$(echo "$i" | awk -F'?' '{print $2}') + local oneargument=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $2}') [ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\"" if ! yunohost app list | grep -q "$oneapp" From 1386466d7e22c7299ced142fe9c1feaf74e2c3d9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 22:46:25 +0100 Subject: [PATCH 07/19] Update helpers/app Co-authored-by: Alexandre Aubin --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 8745e2363..9d2af2455 100644 --- a/helpers/app +++ b/helpers/app @@ -63,7 +63,7 @@ ynh_remove_apps() { for i in "${apps_list[@]}" do # Retrieve the name of the app (part before _ynh) - local oneapp=$(echo "$i" | awk -F'_ynh' '{print $1}') + local oneapp=$(echo "$i" | awk -F'?' '{print $1}') [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to remove" ynh_app_setting_delete --app=$app --key=require_$oneapp From 756e3b292b6e03d4ff23fb028801e9a66356e801 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 22:47:33 +0100 Subject: [PATCH 08/19] Update helpers/app Co-authored-by: Alexandre Aubin --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 9d2af2455..6a646571d 100644 --- a/helpers/app +++ b/helpers/app @@ -83,7 +83,7 @@ ynh_remove_apps() { done # If $oneapp is no more required - if [[ ! $required_by ]] + if [[ -z "$required_by" ]] then # Remove $oneapp ynh_print_info --message="Removing of $oneapp" From 3bb8ca2e21c9cf8fe8da90bea589bb1102e3f75e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 22:47:43 +0100 Subject: [PATCH 09/19] Update helpers/app Co-authored-by: Alexandre Aubin --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 6a646571d..6ad8e20c9 100644 --- a/helpers/app +++ b/helpers/app @@ -75,7 +75,7 @@ ynh_remove_apps() { for installed_app in $installed_apps do local installed_app_required_by=$(ynh_app_setting_get --app=$installed_app --key="require_$oneapp") - if [[ $installed_app_required_by ]] + if [[ -n "$installed_app_required_by" ]] then required_by="${installed_app_required_by}" fi From 5736aadd10098bdc108cab524a6a5c4204e8176b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 23:45:09 +0100 Subject: [PATCH 10/19] typo --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 6ad8e20c9..0908a1236 100644 --- a/helpers/app +++ b/helpers/app @@ -44,7 +44,7 @@ ynh_install_apps() { # # apps will be removed only if no other apps need them. # -# usage: ynh_remove_apps --apps="a_ynh b_ynh?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" +# usage: ynh_remove_apps --apps="appfoo appbar?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" # | arg: -a, --apps= - apps to install # # Requires YunoHost version *.*.* or higher. From 700f671527bccf004eccbd2eef106355140e1f46 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 23:45:43 +0100 Subject: [PATCH 11/19] better yunohost app list --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 0908a1236..4b7628acc 100644 --- a/helpers/app +++ b/helpers/app @@ -28,7 +28,7 @@ ynh_install_apps() { local oneargument=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $2}') [ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\"" - if ! yunohost app list | grep -q "$oneapp" + if ! yunohost app list --output-as json --quiet | jq -e --arg id $oneapp '.apps[] | select(.id == $id)' >/dev/null then yunohost tools update yunohost app install $oneapp $oneargument From ca54e3a61d74b360d00274f0df4c6f9ec03583c5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Mar 2022 23:48:47 +0100 Subject: [PATCH 12/19] Better yunohost tools update --- helpers/app | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/app b/helpers/app index 4b7628acc..70243550b 100644 --- a/helpers/app +++ b/helpers/app @@ -28,12 +28,12 @@ ynh_install_apps() { local oneargument=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $2}') [ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\"" + # Installing or upgrading the app + yunohost tools update apps if ! yunohost app list --output-as json --quiet | jq -e --arg id $oneapp '.apps[] | select(.id == $id)' >/dev/null then - yunohost tools update yunohost app install $oneapp $oneargument else - yunohost tools update yunohost app upgrade $oneapp $oneargument fi ynh_app_setting_set --app=$app --key=require_$oneapp --value="1" From 85ddb4a8a0c36650dd3ebbae902ece000af2d89a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 17 Mar 2022 00:03:38 +0100 Subject: [PATCH 13/19] better yunohost app list --- helpers/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/app b/helpers/app index 70243550b..67479ec09 100644 --- a/helpers/app +++ b/helpers/app @@ -69,7 +69,7 @@ ynh_remove_apps() { ynh_app_setting_delete --app=$app --key=require_$oneapp # List apps requiring $oneapp - local installed_apps=$(yunohost app list | grep -oP 'id: \K.*$') + local installed_apps=$(yunohost app list --output-as json --quiet | jq -r .apps[].id) local required_by="" local installed_app_required_by="" for installed_app in $installed_apps From a07328c99ddd4a2162df77df93cb2bb1263d872c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 17 Mar 2022 19:24:03 +0100 Subject: [PATCH 14/19] removal simplification --- helpers/app | 126 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 54 deletions(-) diff --git a/helpers/app b/helpers/app index 67479ec09..d272194af 100644 --- a/helpers/app +++ b/helpers/app @@ -1,6 +1,6 @@ #!/bin/bash -# Install other YunoHost apps +# Install other YunoHost apps when they are not multi-instance # # usage: ynh_install_apps --apps="appfoo appbar?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" # | arg: -a, --apps= - apps to install @@ -16,78 +16,96 @@ ynh_install_apps() { # Split the list of apps in an array local apps_list=($(echo $apps | tr " " "\n")) + local apps_dependencies="" # For each app - for oneapp_and_its_args in "${apps_list[@]}" + for one_app_and_its_args in "${apps_list[@]}" do - # Retrieve the name of the app (part before _ynh) - local oneapp=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $1}') - [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to install" + # Retrieve the name of the app (part before ?) + local one_app=$(echo "$one_app_and_its_args" | awk -F'?' '{print $1}') + [ -z "$one_app" ] && ynh_die --message="You didn't provided a YunoHost app to install" - # Retrieve the arguments of the app (part after ?) - local oneargument=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $2}') - [ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\"" - - # Installing or upgrading the app yunohost tools update apps - if ! yunohost app list --output-as json --quiet | jq -e --arg id $oneapp '.apps[] | select(.id == $id)' >/dev/null + + # Installing or upgrading the app depending if it's installed or not + if ! yunohost app list --output-as json --quiet | jq -e --arg id $one_app '.apps[] | select(.id == $id)' >/dev/null then - yunohost app install $oneapp $oneargument + # Retrieve the arguments of the app (part after ?) + local one_argument=$(echo "$one_app_and_its_args" | awk -F'?' '{print $2}') + [ ! -z "$one_argument" ] && one_argument="--args \"$one_argument\"" + + # Install the app with its arguments + yunohost app install $one_app $one_argument else - yunohost app upgrade $oneapp $oneargument + # Upgrade the app + yunohost app upgrade $one_app + fi + + if [ ! -z "$apps_dependencies" ] + then + apps_dependencies="$apps_dependencies, $one_app" + else + apps_dependencies="$one_app" fi - ynh_app_setting_set --app=$app --key=require_$oneapp --value="1" done + + ynh_app_setting_set --app=$app --key=apps_dependencies --value="$apps_dependencies" } # Remove other YunoHost apps # -# apps will be removed only if no other apps need them. +# Other YunoHost apps will be removed only if no other apps need them. # -# usage: ynh_remove_apps --apps="appfoo appbar?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" -# | arg: -a, --apps= - apps to install +# usage: ynh_remove_apps # # Requires YunoHost version *.*.* or higher. ynh_remove_apps() { - # Declare an array to define the options of this helper. - local legacy_args=a - local -A args_array=([a]=app=) - local app - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - # Split the list of apps in an array - local apps_list=($(echo $apps | tr " " "\n")) - - # For each app - for i in "${apps_list[@]}" - do - # Retrieve the name of the app (part before _ynh) - local oneapp=$(echo "$i" | awk -F'?' '{print $1}') - [ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to remove" + # Retrieve the apps dependencies of the app + local apps_dependencies=$(ynh_app_setting_get --app=$app --key=apps_dependencies) || true + ynh_app_setting_delete --app=$app --key=apps_dependencies || true - ynh_app_setting_delete --app=$app --key=require_$oneapp - - # List apps requiring $oneapp - local installed_apps=$(yunohost app list --output-as json --quiet | jq -r .apps[].id) - local required_by="" - local installed_app_required_by="" - for installed_app in $installed_apps + if [ ! -z "$apps_dependencies" ] + then + # Split the list of apps dependencies in an array + local apps_dependencies_list=($(echo $apps_dependencies | tr ", " "\n")) + + # For each apps dependencies + for one_app in "${apps_dependencies_list[@]}" do - local installed_app_required_by=$(ynh_app_setting_get --app=$installed_app --key="require_$oneapp") - if [[ -n "$installed_app_required_by" ]] - then - required_by="${installed_app_required_by}" - fi - installed_app_required_by="" - done + # Retrieve the list of installed apps + local installed_apps_list=$(yunohost app list --output-as json --quiet | jq -r .apps[].id) + local required_by="" + local installed_app_required_by="" - # If $oneapp is no more required - if [[ -z "$required_by" ]] - then - # Remove $oneapp - ynh_print_info --message="Removing of $oneapp" - yunohost app remove $oneapp --purge - fi - done + # For each other installed app + for one_installed_app in $installed_apps_list + do + # Retrieve the other apps dependencies + one_installed_apps_dependencies=$(ynh_app_setting_get --app=$one_installed_app --key=apps_dependencies) + if [ ! -z "$one_installed_apps_dependencies" ] + then + one_installed_apps_dependencies_list=($(echo $one_installed_apps_dependencies | tr ", " "\n")) + + # For each dependency of the other apps + for one_installed_app_dependency in "${one_installed_apps_dependencies_list[@]}" + do + if [[ $one_installed_app_dependency == $one_app ]]; then + required_by="$required_by $one_installed_app" + fi + done + fi + done + + # If $one_app is no more required + if [[ -z "$required_by" ]] + then + # Remove $one_app + ynh_print_info --message="Removing of $one_app" + yunohost app remove $one_app --purge + else + ynh_print_info --message="$one_app was not removed because it's still required by${required_by}" + fi + done + fi } From 1bcaa934ee9f60b475302cae9eee68ff80a56ace Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 31 Mar 2022 20:40:32 +0200 Subject: [PATCH 15/19] Better resilience to `?` used in password --- helpers/app | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers/app b/helpers/app index d272194af..7bbf351c0 100644 --- a/helpers/app +++ b/helpers/app @@ -1,8 +1,8 @@ #!/bin/bash -# Install other YunoHost apps when they are not multi-instance +# Install others YunoHost apps # -# usage: ynh_install_apps --apps="appfoo appbar?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666" +# usage: ynh_install_apps --apps="appfoo?domain=domain.foo&path=/foo appbar?domain=domain.bar&path=/bar&admin=USER&language=fr&is_public=1&pass?word=pass&port=666" # | arg: -a, --apps= - apps to install # # Requires YunoHost version *.*.* or higher. @@ -22,7 +22,7 @@ ynh_install_apps() { for one_app_and_its_args in "${apps_list[@]}" do # Retrieve the name of the app (part before ?) - local one_app=$(echo "$one_app_and_its_args" | awk -F'?' '{print $1}') + local one_app=$(cut -d "?" -f1 <<< "$str") [ -z "$one_app" ] && ynh_die --message="You didn't provided a YunoHost app to install" yunohost tools update apps @@ -31,7 +31,7 @@ ynh_install_apps() { if ! yunohost app list --output-as json --quiet | jq -e --arg id $one_app '.apps[] | select(.id == $id)' >/dev/null then # Retrieve the arguments of the app (part after ?) - local one_argument=$(echo "$one_app_and_its_args" | awk -F'?' '{print $2}') + local one_argument=$(cut -d "?" -f2- <<< "$one_app_and_its_args") [ ! -z "$one_argument" ] && one_argument="--args \"$one_argument\"" # Install the app with its arguments From 8810561825591b4954d3243ebf98e09aa010e3a8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 31 Mar 2022 20:41:53 +0200 Subject: [PATCH 16/19] renaming helper file --- helpers/{app => apps} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename helpers/{app => apps} (100%) diff --git a/helpers/app b/helpers/apps similarity index 100% rename from helpers/app rename to helpers/apps From 244b31f07f7d8706e15c7201a2d7c1983cb014be Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 1 Apr 2022 02:04:30 +0200 Subject: [PATCH 17/19] typo --- helpers/apps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/apps b/helpers/apps index 7bbf351c0..72b2c27e0 100644 --- a/helpers/apps +++ b/helpers/apps @@ -22,7 +22,7 @@ ynh_install_apps() { for one_app_and_its_args in "${apps_list[@]}" do # Retrieve the name of the app (part before ?) - local one_app=$(cut -d "?" -f1 <<< "$str") + local one_app=$(cut -d "?" -f1 <<< "$one_app_and_its_args") [ -z "$one_app" ] && ynh_die --message="You didn't provided a YunoHost app to install" yunohost tools update apps From c34bd72ef695bf16fb56105abf5c2fba7411cbd2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Apr 2022 22:43:57 +0200 Subject: [PATCH 18/19] remove not needed true --- helpers/apps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/apps b/helpers/apps index 72b2c27e0..d44143db3 100644 --- a/helpers/apps +++ b/helpers/apps @@ -62,8 +62,8 @@ ynh_install_apps() { ynh_remove_apps() { # Retrieve the apps dependencies of the app - local apps_dependencies=$(ynh_app_setting_get --app=$app --key=apps_dependencies) || true - ynh_app_setting_delete --app=$app --key=apps_dependencies || true + local apps_dependencies=$(ynh_app_setting_get --app=$app --key=apps_dependencies) + ynh_app_setting_delete --app=$app --key=apps_dependencies if [ ! -z "$apps_dependencies" ] then From c749c441107e7a7791cff32f4e5c760cc8940b93 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Apr 2022 22:49:14 +0200 Subject: [PATCH 19/19] typo --- helpers/apps | 1 - 1 file changed, 1 deletion(-) diff --git a/helpers/apps b/helpers/apps index d44143db3..0ab557542 100644 --- a/helpers/apps +++ b/helpers/apps @@ -60,7 +60,6 @@ ynh_install_apps() { # # Requires YunoHost version *.*.* or higher. ynh_remove_apps() { - # Retrieve the apps dependencies of the app local apps_dependencies=$(ynh_app_setting_get --app=$app --key=apps_dependencies) ynh_app_setting_delete --app=$app --key=apps_dependencies