Rename heper

This commit is contained in:
Josué Tille 2020-04-14 14:03:04 +02:00
parent fec5d3d084
commit 17e8bdedf6
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF

View file

@ -489,23 +489,24 @@ ynh_check_app_version_changed () {
# Compare the current package version against another version given as an argument. # Compare the current package version against another version given as an argument.
# This is really useful when we need to do some actions only for some old package versions. # This is really useful when we need to do some actions only for some old package versions.
# #
# example: ynh_compare_package_version --comparison gt --version 2.3.2~ynh1 # example: ynh_compare_current_package_version --comparison gt --version 2.3.2~ynh1
# This example will check if the installed version is greater than (gt) the version 2.3.2~ynh1 # This example will check if the installed version is greater than (gt) the version 2.3.2~ynh1
# #
# Generally you might probably use it as follow in the upgrade script # Generally you might probably use it as follow in the upgrade script
# #
# if ynh_compare_package_version --comparaison gt --version 2.3.2~ynh1; then # if ynh_compare_current_package_version --comparaison gt --version 2.3.2~ynh1
# then
# # Do something that is needed for the package version older than 2.3.2~ynh1 # # Do something that is needed for the package version older than 2.3.2~ynh1
# fi # fi
# #
# usage: ynh_compare_package_version --comparison lt|gt|le|ge # usage: ynh_compare_current_package_version --comparison lt|gt|le|ge
# | arg: --comparison - Comparison type. Could be : le (lower than), gt (greater than), le (lower or equal), ge (greater or equal) # | arg: --comparison - Comparison type. Could be : le (lower than), gt (greater than), le (lower or equal), ge (greater or equal)
# | arg: --version - The version to compare. Need to be a version in the yunohost package version type (like 2.3.1~ynh4) # | arg: --version - The version to compare. Need to be a version in the yunohost package version type (like 2.3.1~ynh4)
# #
# Return 0 if the evaluation is true. 1 if false. # Return 0 if the evaluation is true. 1 if false.
# #
# Requires YunoHost version 3.8.0 or higher. # Requires YunoHost version 3.8.0 or higher.
ynh_compare_package_version() { ynh_compare_current_package_version() {
local legacy_args=cv local legacy_args=cv
declare -Ar args_array=( [c]=comparison= [v]=version= ) declare -Ar args_array=( [c]=comparison= [v]=version= )
local version local version