Does not try to upgrade on failed install

This commit is contained in:
Maniack Crudelis 2020-04-24 14:08:03 +02:00
parent 5ecb78e4e7
commit 7f909cc02a

View file

@ -743,7 +743,7 @@ CHECK_UPGRADE () {
# Backup the modified arguments # Backup the modified arguments
update_manifest_args="$manifest_args_mod" update_manifest_args="$manifest_args_mod"
# Get the arguments of the manifest for this upgrade. # Get the arguments of the manifest for this upgrade.
manifest_args_mod=$(grep "^manifest_arg=" "$partial_check_process" | cut -d'=' -f2-) manifest_args_mod="$(grep "^manifest_arg=" "$partial_check_process" | cut -d'=' -f2-)"
if [ -z "$manifest_args_mod" ]; then if [ -z "$manifest_args_mod" ]; then
# If there's no specific arguments, use the previous one. # If there's no specific arguments, use the previous one.
manifest_args_mod="$update_manifest_args" manifest_args_mod="$update_manifest_args"
@ -771,6 +771,7 @@ CHECK_UPGRADE () {
if [ $yunohost_result -ne 0 ] if [ $yunohost_result -ne 0 ]
then then
ECHO_FORMAT "\nInstallation failed...\n" "red" "bold" ECHO_FORMAT "\nInstallation failed...\n" "red" "bold"
ECHO_FORMAT "\nUpgrade test ignored...\n" "red" "bold"
else else
ECHO_FORMAT "\nUpgrade...\n" "white" "bold" clog ECHO_FORMAT "\nUpgrade...\n" "white" "bold" clog
@ -796,21 +797,21 @@ CHECK_UPGRADE () {
# Try to access the app by its url # Try to access the app by its url
CHECK_URL CHECK_URL
fi
# Check the result and print SUCCESS or FAIL # Check the result and print SUCCESS or FAIL
if check_test_result if check_test_result
then # Success then # Success
# The global success for an upgrade can't be a success if another upgrade failed # The global success for an upgrade can't be a success if another upgrade failed
if [ $RESULT_check_upgrade -ne -1 ]; then if [ $RESULT_check_upgrade -ne -1 ]; then
RESULT_check_upgrade=1 # Upgrade succeed RESULT_check_upgrade=1 # Upgrade succeed
fi fi
else # Fail else # Fail
RESULT_check_upgrade=-1 # Upgrade failed RESULT_check_upgrade=-1 # Upgrade failed
fi fi
# Remove the application # Remove the application
REMOVE_APP REMOVE_APP
fi
# Uses the default snapshot # Uses the default snapshot
current_snapshot=snap0 current_snapshot=snap0