mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Add comments
This commit is contained in:
parent
14ef523585
commit
3d51e235e8
1 changed files with 7 additions and 0 deletions
|
@ -492,6 +492,12 @@ ynh_check_app_version_changed () {
|
||||||
# example: ynh_compare_package_version --comparison gt --version 2.3.2~ynh1
|
# example: ynh_compare_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
|
||||||
|
#
|
||||||
|
# if ynh_compare_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
|
||||||
|
# fi
|
||||||
|
#
|
||||||
# usage: ynh_compare_package_version --comparison lt|gt|le|ge
|
# usage: ynh_compare_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)
|
||||||
|
@ -519,6 +525,7 @@ ynh_compare_package_version() {
|
||||||
# If the version are identical, and the evaluation allows equal versions.
|
# If the version are identical, and the evaluation allows equal versions.
|
||||||
if [ $version == $current_version ]
|
if [ $version == $current_version ]
|
||||||
then
|
then
|
||||||
|
# manage equals case.
|
||||||
if [ $comparison == ge ] || [ $comparison == le ]; then
|
if [ $comparison == ge ] || [ $comparison == le ]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue