helpers 2.1: ynh_if_upgrading_from_... -> ynh_app_upgrading_from_...

This commit is contained in:
Alexandre Aubin 2024-05-28 00:09:00 +02:00
parent 6835a664c7
commit 80f07a9974

View file

@ -66,8 +66,8 @@ ynh_abort_if_errors() {
trap ynh_exit_properly EXIT # Capturing exit signals on shell script trap ynh_exit_properly EXIT # Capturing exit signals on shell script
} }
# When running an app script with packaging format >= 2, auto-enable ynh_abort_if_errors except for remove script # When running an app script, auto-enable ynh_abort_if_errors except for remove script
if [[ "${YNH_CONTEXT:-}" != "regenconf" ]] && dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} ge 2 && [[ ${YNH_APP_ACTION} != "remove" ]] if [[ "${YNH_CONTEXT:-}" != "regenconf" ]] && [[ "${YNH_APP_ACTION}" != "remove" ]]
then then
ynh_abort_if_errors ynh_abort_if_errors
fi fi
@ -505,10 +505,10 @@ ynh_check_app_version_changed() {
# Compare the current package version is strictly lower than another version given as an argument # Compare the current package version is strictly lower than another version given as an argument
# #
# example: if ynh_if_upgrading_from_version_prior_to 2.3.2~ynh1; then ... # example: if ynh_app_upgrading_from_version_prior_to 2.3.2~ynh1; then ...
# #
# Requires YunoHost version 11.2 or higher. # Requires YunoHost version 11.2 or higher.
ynh_if_upgrading_from_version_prior_to() { ynh_app_upgrading_from_version_prior_to() {
local version=$1 local version=$1
[[ $version =~ '~ynh' ]] || ynh_die --message="Invalid argument for version, should include the ~ynhX prefix" [[ $version =~ '~ynh' ]] || ynh_die --message="Invalid argument for version, should include the ~ynhX prefix"
@ -517,10 +517,10 @@ ynh_if_upgrading_from_version_prior_to() {
# Compare the current package version is lower or equal to another version given as an argument # Compare the current package version is lower or equal to another version given as an argument
# #
# example: if ynh_if_upgrading_from_version_prior_or_equal_to 2.3.2~ynh1; then ... # example: if ynh_app_upgrading_from_version_prior_or_equal_to 2.3.2~ynh1; then ...
# #
# Requires YunoHost version 11.2 or higher. # Requires YunoHost version 11.2 or higher.
ynh_if_upgrading_from_version_prior_or_equal_to() { ynh_app_upgrading_from_version_prior_or_equal_to() {
local version=$1 local version=$1
[[ $version =~ '~ynh' ]] || ynh_die --message="Invalid argument for version, should include the ~ynhX prefix" [[ $version =~ '~ynh' ]] || ynh_die --message="Invalid argument for version, should include the ~ynhX prefix"