Remove legacy references to path_url (instead of path) from packaging v1 era

This commit is contained in:
Alexandre Aubin 2024-06-10 14:51:40 +02:00
parent 9b6ccb7b1f
commit ef7da9e70f
3 changed files with 15 additions and 14 deletions

View file

@ -9,8 +9,8 @@
# format and how placeholders are replaced with actual variables. # format and how placeholders are replaced with actual variables.
# #
# Additionally, ynh_add_nginx_config will replace: # Additionally, ynh_add_nginx_config will replace:
# - `#sub_path_only` by empty string if `path_url` is not `'/'` # - `#sub_path_only` by empty string if `path` is not `'/'`
# - `#root_path_only` by empty string if `path_url` *is* `'/'` # - `#root_path_only` by empty string if `path` *is* `'/'`
# #
# This allows to enable/disable specific behaviors dependenging on the install # This allows to enable/disable specific behaviors dependenging on the install
# location # location
@ -22,7 +22,7 @@ ynh_add_nginx_config() {
ynh_add_config --template="nginx.conf" --destination="$finalnginxconf" ynh_add_config --template="nginx.conf" --destination="$finalnginxconf"
if [ "${path_url:-}" != "/" ]; then if [ "${path:-}" != "/" ]; then
ynh_replace_string --match_string="^#sub_path_only" --replace_string="" --target_file="$finalnginxconf" ynh_replace_string --match_string="^#sub_path_only" --replace_string="" --target_file="$finalnginxconf"
else else
ynh_replace_string --match_string="^#root_path_only" --replace_string="" --target_file="$finalnginxconf" ynh_replace_string --match_string="^#root_path_only" --replace_string="" --target_file="$finalnginxconf"

View file

@ -22,13 +22,13 @@
# `destination` by replacing the following keywords with global variables # `destination` by replacing the following keywords with global variables
# that should be defined before calling this helper : # that should be defined before calling this helper :
# ``` # ```
# __PATH__ by $path_url
# __USER__ by $app # __USER__ by $app
# __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH # __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH
# ``` # ```
# And any dynamic variables that should be defined before calling this helper like: # And any dynamic variables that should be defined before calling this helper like:
# ``` # ```
# __DOMAIN__ by $domain # __DOMAIN__ by $domain
# __PATH__ by $path
# __APP__ by $app # __APP__ by $app
# __VAR_1__ by $var_1 # __VAR_1__ by $var_1
# __VAR_2__ by $var_2 # __VAR_2__ by $var_2
@ -125,7 +125,8 @@ ynh_add_config() {
# #
# The helper will replace the following keywords with global variables # The helper will replace the following keywords with global variables
# that should be defined before calling this helper : # that should be defined before calling this helper :
# __PATH__ by $path_url # __PATH__ by $path
# __PATH__/ by $path/ if $path != /, or just / otherwise (instead of //)
# __USER__ by $app # __USER__ by $app
# __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH # __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH
# #
@ -144,11 +145,11 @@ ynh_replace_vars() {
# =========================================== # ===========================================
# Replace specific YunoHost variables # Replace specific YunoHost variables
if test -n "${path_url:-}"; then if test -n "${path:-}"; then
# path_url_slash_less is path_url, or a blank value if path_url is only '/' # path_slash_less is path, or a blank value if path is only '/'
local path_url_slash_less=${path_url%/} local path_slash_less=${path%/}
ynh_replace_string --match_string="__PATH__/" --replace_string="$path_url_slash_less/" --target_file="$file" ynh_replace_string --match_string="__PATH__/" --replace_string="$path_slash_less/" --target_file="$file"
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$file" ynh_replace_string --match_string="__PATH__" --replace_string="$path" --target_file="$file"
fi fi
if test -n "${app:-}"; then if test -n "${app:-}"; then
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$file" ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$file"

View file

@ -353,7 +353,7 @@ ynh_setup_source() {
# Curl abstraction to help with POST requests to local pages (such as installation forms) # Curl abstraction to help with POST requests to local pages (such as installation forms)
# #
# usage: ynh_local_curl "page_uri" "key1=value1" "key2=value2" ... # usage: ynh_local_curl "page_uri" "key1=value1" "key2=value2" ...
# | arg: page_uri - Path (relative to `$path_url`) of the page where POST data will be sent # | arg: page_uri - Path (relative to `$path`) of the page where POST data will be sent
# | arg: key1=value1 - (Optionnal) POST key and corresponding value # | arg: key1=value1 - (Optionnal) POST key and corresponding value
# | arg: key2=value2 - (Optionnal) Another POST key and corresponding value # | arg: key2=value2 - (Optionnal) Another POST key and corresponding value
# | arg: ... - (Optionnal) More POST keys and values # | arg: ... - (Optionnal) More POST keys and values
@ -362,15 +362,15 @@ ynh_setup_source() {
# #
# For multiple calls, cookies are persisted between each call for the same app # For multiple calls, cookies are persisted between each call for the same app
# #
# `$domain` and `$path_url` should be defined externally (and correspond to the domain.tld and the /path (of the app?)) # `$domain` and `$path` should be defined externally (and correspond to the domain.tld and the /path (of the app?))
# #
# Requires YunoHost version 2.6.4 or higher. # Requires YunoHost version 2.6.4 or higher.
ynh_local_curl() { ynh_local_curl() {
# Define url of page to curl # Define url of page to curl
local local_page=$(ynh_normalize_url_path $1) local local_page=$(ynh_normalize_url_path $1)
local full_path=$path_url$local_page local full_path=$path$local_page
if [ "${path_url}" == "/" ]; then if [ "${path}" == "/" ]; then
full_path=$local_page full_path=$local_page
fi fi