diff --git a/packaging_apps_helpers.md b/packaging_apps_helpers.md index ec86209b..4669f161 100644 --- a/packaging_apps_helpers.md +++ b/packaging_apps_helpers.md @@ -2,7 +2,7 @@

App helpers

-

Doc auto-generated by this script on 11/04/2020 (Yunohost version 4.0.8.2)

+

Doc auto-generated by this script on 12/31/2020 (Yunohost version 4.1.2)

@@ -51,7 +51,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -106,7 +106,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -142,7 +142,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -189,7 +189,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -236,7 +236,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -283,7 +283,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -330,7 +330,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -377,7 +377,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -428,7 +428,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -464,7 +464,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -523,7 +523,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -586,12 +586,12 @@

Details:

- This helper can be used both in a system backup hook, and in an app backup script

Details: ynh_backup writes SRC and the relative DEST into a CSV file. And it
creates the parent destination directory

If DEST is ended by a slash it complete this path with the basename of SRC.

Example in the context of a wordpress app

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
# => This line will be added into CSV file
# "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/etc/nginx/conf.d/$domain.d/$app.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf/nginx.conf"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/nginx.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf/"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/$app.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf"

#Deprecated usages (maintained for retro-compatibility)
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "${backup_dir}/conf/nginx.conf"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/nginx.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "/conf/"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/$app.conf"

Requires YunoHost version 2.4.0 or higher.
Requires YunoHost version 3.5.0 or higher for the argument --not_mandatory

+ This helper can be used both in a system backup hook, and in an app backup script

Details: ynh_backup writes SRC and the relative DEST into a CSV file. And it
creates the parent destination directory

If DEST is ended by a slash it complete this path with the basename of SRC.

Example in the context of a wordpress app

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
# => This line will be added into CSV file
# "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/etc/nginx/conf.d/$domain.d/$app.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf/nginx.conf"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/nginx.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf/"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/$app.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf"

#Deprecated usages (maintained for retro-compatibility)
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "${backup_dir}/conf/nginx.conf"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/nginx.conf"

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "/conf/"
# => "/etc/nginx/conf.d/$domain.d/$app.conf","apps/wordpress/conf/$app.conf"

How to use --is_big:
--is_big is used to specify that this part of the backup can be quite huge.
So, you don't want that your package does backup that part during ynh_backup_before_upgrade.
In the same way, an user may doesn't want to backup this big part of the app for
each of his backup. And so handle that part differently.

As this part of your backup may not be done, your restore script has to handle it.
In your restore script, use --not_mandatory with ynh_restore_file
As well in your remove script, you should not remove those data ! Or an user may end up with
a failed upgrade restoring an app without data anymore !

To have the benefit of --is_big while doing a backup, you can whether set the environement
variable BACKUP_CORE_ONLY to 1 (BACKUP_CORE_ONLY=1) before the backup command. It will affect
only that backup command.
Or set the config do_not_backup_data to 1 into the settings.yml of the app. This will affect
all backups for this app until the setting is removed.

Requires YunoHost version 2.4.0 or higher.
Requires YunoHost version 3.5.0 or higher for the argument --not_mandatory

- Dude, show me the code ! + Dude, show me the code !

@@ -627,7 +627,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -703,7 +703,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -750,7 +750,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -801,7 +801,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -848,7 +848,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -888,7 +888,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -928,7 +928,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1002,7 +1002,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1038,7 +1038,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1111,7 +1111,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1175,7 +1175,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1231,7 +1231,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1278,7 +1278,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1325,7 +1325,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1372,7 +1372,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1420,7 +1420,7 @@ ynh_exec_err "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1468,7 +1468,7 @@ ynh_exec_warn "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1516,7 +1516,7 @@ ynh_exec_warn_less "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1564,7 +1564,7 @@ ynh_exec_quiet "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1612,7 +1612,7 @@ ynh_exec_fully_quiet "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1648,7 +1648,7 @@ ynh_exec_fully_quiet "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1684,7 +1684,7 @@ ynh_exec_fully_quiet "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1743,7 +1743,7 @@ ynh_exec_fully_quiet "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1780,7 +1780,7 @@ ynh_exec_fully_quiet "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1831,7 +1831,7 @@ ynh_exec_fully_quiet "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1879,7 +1879,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1939,7 +1939,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -1975,7 +1975,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2039,7 +2039,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2090,7 +2090,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2141,7 +2141,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2196,7 +2196,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2244,7 +2244,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2299,7 +2299,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2350,7 +2350,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2410,7 +2410,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2462,7 +2462,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2517,7 +2517,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2572,7 +2572,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2624,7 +2624,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2660,7 +2660,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2701,7 +2701,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2748,7 +2748,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2784,7 +2784,7 @@ ynh_debug_exec "your_command | other_command"

- Dude, show me the code ! + Dude, show me the code !

@@ -2875,7 +2875,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -2911,7 +2911,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -2987,7 +2987,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3038,7 +3038,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3089,7 +3089,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3144,7 +3144,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3192,7 +3192,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3240,7 +3240,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3295,7 +3295,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3346,7 +3346,7 @@ watch -n0.5 ps -o user,cmd,%cpu,rss -u APP

- Dude, show me the code ! + Dude, show me the code !

@@ -3384,7 +3384,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3440,7 +3440,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3495,7 +3495,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3546,7 +3546,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3601,7 +3601,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3660,7 +3660,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3680,7 +3680,14 @@ Please always call this script in install and restore scripts

- Usage: ynh_permission_create --permission "permission" [--url=url] [--allowed="group1 group2"] + Usage: ynh_permission_create --permission="permission" [--url="url"] [--additional_urls="second-url" [ "third-url" ]] [--auth_header=true|false] + [--allowed=group1 [ group2 ]] [--label="label"] [--show_tile=true|false] + [--protected=true|false] +| Not that if 'show_tile' is enabled, this URL will be the URL of the tile. +| Default is "APP_LABEL (permission name)". +| Default is false (for the permission different than 'main'). +| won't be able to add or remove the visitors group of this permission. +| By default it's 'false'

@@ -3689,15 +3696,35 @@ Please always call this script in install and restore scripts @@ -3705,21 +3732,17 @@ Please always call this script in install and restore scripts -

- Example: ynh_permission_create --permission=admin --url=/admin --allowed="alice bob" -

-

Details:

- If provided, 'url' is assumed to be relative to the app domain/path if they
start with '/'. For example:
/ -> domain.tld/app
/admin -> domain.tld/app/admin
domain.tld/app/api -> domain.tld/app/api

'url' can be later treated as a regex if it starts with "re:".
For example:
re:/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$
re:domain.tld/app/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$

Requires YunoHost version 3.7.0 or higher.

+ example 1: ynh_permission_create --permission=admin --url=/admin --additional_urls=domain.tld/admin /superadmin --allowed=alice bob \
--label="My app admin" --show_tile=true

This example will create a new permission permission with this following effect:
- A tile named "My app admin" in the SSO will be available for the users alice and bob. This tile will point to the relative url '/admin'.
- Only the user alice and bob will have the access to theses following url: /admin, domain.tld/admin, /superadmin

example 2: ynh_permission_create --permission=api --url=domain.tld/api --auth_header=false --allowed=visitors \
--label="MyApp API" --protected=true

This example will create a new protected permission. So the admin won't be able to add/remove the visitors group of this permission.
In case of an API with need to be always public it avoid that the admin break anything.
With this permission all client will be allowed to access to the url 'domain.tld/api'.
Note that in this case no tile will be show on the SSO.
Note that the auth_header parameter is to 'false'. So no authentication header will be passed to the application.
Generally the API is requested by an application and enabling the auth_header has no advantage and could bring some issues in some case.
So in this case it's better to disable this option for all API.

If provided, 'url' or 'additional_urls' is assumed to be relative to the app domain/path if they
start with '/'. For example:
/ -> domain.tld/app
/admin -> domain.tld/app/admin
domain.tld/app/api -> domain.tld/app/api

'url' or 'additional_urls' can be treated as a PCRE (not lua) regex if it starts with "re:".
For example:
re:/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$
re:domain.tld/app/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$

Note that globally the parameter 'url' and 'additional_urls' are same. The only difference is:
- 'url' is only one url, 'additional_urls' can be a list of urls. There are no limitation of 'additional_urls'
- 'url' is used for the url of tile in the SSO (if enabled with the 'show_tile' parameter)

About the authentication header (auth_header parameter).
The SSO pass (by default) to the application theses following HTTP header (linked to the authenticated user) to the application:
- "Auth-User": username
- "Remote-User": username
- "Email": user email

Generally this feature is usefull to authenticate automatically the user in the application but in some case the application don't work with theses header and theses header need to be disabled to have the application to work correctly.
See https://github.com/YunoHost/issues/issues/1420 for more informations

Requires YunoHost version 3.7.0 or higher.

- Dude, show me the code ! + Dude, show me the code !

@@ -3770,7 +3793,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3818,7 +3841,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3838,7 +3861,9 @@ Please always call this script in install and restore scripts

- Usage: ynh_permission_url --permission="permission" [--url="url"] + Usage: ynh_permission_url --permission "permission" [--url="url"] [--add_url="new-url" [ "other-new-url" ]] [--remove_url="old-url" [ "other-old-url" ]] + [--auth_header=true|false] [--clear_urls] +| Note that if you want to remove url you can pass an empty sting as arguments ("").

@@ -3847,11 +3872,27 @@ Please always call this script in install and restore scripts @@ -3869,7 +3910,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3889,7 +3930,9 @@ Please always call this script in install and restore scripts

- Usage: ynh_permission_update --permission="permission" [--add="group1 group2"] [--remove="group1 group2"] + Usage: ynh_permission_update --permission "permission" [--add="group" ["group" ...]] [--remove="group" ["group" ...]] + [--label="label"] [--show_tile=true|false] [--protected=true|false] +| won't be able to add or remove the visitors group of this permission.

@@ -3898,15 +3941,27 @@ Please always call this script in install and restore scripts @@ -3914,10 +3969,6 @@ Please always call this script in install and restore scripts -

- Example: ynh_permission_update --permission admin --add=samdoe --remove=all_users -

-

@@ -3928,7 +3979,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -3984,7 +4035,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -4044,7 +4095,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -4099,7 +4150,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -4154,7 +4205,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -4210,7 +4261,7 @@ Please always call this script in install and restore scripts

- Dude, show me the code ! + Dude, show me the code !

@@ -4271,7 +4322,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4318,7 +4369,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4385,7 +4436,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4422,7 +4473,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4479,7 +4530,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4538,7 +4589,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4582,7 +4633,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4630,7 +4681,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4678,7 +4729,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4759,7 +4810,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4806,7 +4857,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4847,7 +4898,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4898,7 +4949,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -4961,7 +5012,79 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code ! +

+ + + + + + + + +
+
+
+
ynh_add_config
+
Create a dedicated config file from a template
+
+
+
+

+ + Usage: ynh_add_config --template="template" --destination="destination" + +

+ +

+ Arguments: +

    + + +
  • -t, --template= : Template config file to use
  • + + + +
  • -d, --destination= : Destination of the config file
  • + + +
+

+ + + + +

+ Examples:

    + + + ynh_add_config --template=".env" --destination="$final_path/.env" + +
    + + + ynh_add_config --template="../conf/.env" --destination="$final_path/.env" + +
    + + + ynh_add_config --template="/etc/nginx/sites-available/default" --destination="etc/nginx/sites-available/mydomain.conf" + +
    + +
+

+ + +

+ Details: +

+ The template can be by default the name of a file in the conf directory
of a YunoHost Package, a relative path or an absolute path
The helper will use the template $template to generate a config file
$destination by replacing the following keywords with global variables
that should be defined before calling this helper :
__PATH__ by $path_url
__NAME__ by $app
__NAMETOCHANGE__ by $app
__USER__ by $app
__FINALPATH__ by $final_path
__PHPVERSION__ by $YNH_PHP_VERSION
__YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH

And any dynamic variables that should be defined before calling this helper like:
__DOMAIN__ by $domain
__APP__ by $app
__VAR_1__ by $var_1
__VAR_2__ by $var_2

The helper will verify the checksum and backup the destination file
if it's different before applying the new template.
And it will calculate and store the destination file checksum
into the app settings when configuration is done.

Requires YunoHost version 4.1.0 or higher.

+

+

+ +

+ Dude, show me the code !

@@ -5001,7 +5124,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -5048,7 +5171,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -5103,7 +5226,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -5117,7 +5240,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="
ynh_app_upstream_version
-
Read the upstream version from the manifest
+
Read the upstream version from the manifest, or from the env variable $YNH_APP_MANIFEST_VERSION if not given

@@ -5154,7 +5277,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -5205,7 +5328,7 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code !

@@ -5241,7 +5364,64 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var="

- Dude, show me the code ! + Dude, show me the code ! +

+ + + + + + + + +
+
+
+
ynh_compare_current_package_version
+
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.
+
+
+
+

+ + Usage: ynh_compare_current_package_version --comparison lt|le|eq|ne|ge|gt +| eq (equal), ne (not equal), ge (greater or equal), gt (greater than) + +

+ +

+ Arguments: +

    + + +
  • --comparison : Comparison type. Could be : lt (lower than), le (lower or equal),
  • + + + +
  • --version : The version to compare. Need to be a version in the yunohost package version type (like 2.3.1~ynh4)
  • + + +
+

+ + + +

+ Example: ynh_compare_current_package_version --comparison lt --version 2.3.2~ynh1 This example will check if the installed version is lower than (lt) the version 2.3.2~ynh1 +

+ + + +

+ Details: +

+ Generally you might probably use it as follow in the upgrade script

if ynh_compare_current_package_version --comparaison lt --version 2.3.2~ynh1
then
# Do something that is needed for the package version older than 2.3.2~ynh1
fi

Return 0 if the evaluation is true. 1 if false.

Requires YunoHost version 3.8.0 or higher.

+

+

+ +

+ Dude, show me the code !

@@ -5278,4 +5458,4 @@ ynh_add_systemd_config [--service=service] [--template=template] [--others_var=" } /*===============================================*/ - + \ No newline at end of file