From 1c62960e25c9004162a0cdc272dd2898b85952f6 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 30 Jun 2024 20:10:21 +0200 Subject: [PATCH] helpers2.1: remove the ynh_clean_setup mechanism underused/useless.. --- helpers/helpers.v2.1.d/utils | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/helpers/helpers.v2.1.d/utils b/helpers/helpers.v2.1.d/utils index 5d2c72e16..4c611395d 100644 --- a/helpers/helpers.v2.1.d/utils +++ b/helpers/helpers.v2.1.d/utils @@ -6,17 +6,6 @@ YNH_APP_BASEDIR=${YNH_APP_BASEDIR:-$(realpath ..)} # # [internal] # -# usage: -# ynh_exit_properly is used only by the helper ynh_abort_if_errors. -# You should not use it directly. -# Instead, add to your script: -# ynh_clean_setup () { -# instructions... -# } -# -# This function provide a way to clean some residual of installation that not managed by remove script. -# -# It prints a warning to inform that the script was failed, and execute the ynh_clean_setup function if used in the app script ynh_exit_properly() { local exit_code=$? @@ -37,10 +26,6 @@ ynh_exit_properly() { # Small tempo to avoid the next message being mixed up with other DEBUG messages sleep 0.5 - if type -t ynh_clean_setup >/dev/null; then # Check if the function exist in the app script. - ynh_clean_setup # Call the function to do specific cleaning for the app. - fi - # Exit with error status # We don't call ynh_die basically to avoid unecessary 10-ish # debug lines about parsing args and stuff just to exit 1.. @@ -55,7 +40,6 @@ ynh_exit_properly() { # # This configure the rest of the script execution such that, if an error occurs # or if an empty variable is used, the execution of the script stops immediately -# and a call to `ynh_clean_setup` is triggered if it has been defined by your script. ynh_abort_if_errors() { set -o errexit # set -e; Exit if a command fail set -o nounset # set -u; And if a variable is used unset