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.
#
# Additionally, ynh_add_nginx_config will replace:
# - `#sub_path_only` by empty string if `path_url` is not `'/'`
# - `#root_path_only` by empty string if `path_url` *is* `'/'`
# - `#sub_path_only` by empty string if `path` is not `'/'`
# - `#root_path_only` by empty string if `path` *is* `'/'`
#
# This allows to enable/disable specific behaviors dependenging on the install
# location
@ -22,7 +22,7 @@ ynh_add_nginx_config() {
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"
else
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
# that should be defined before calling this helper :
# ```
# __PATH__ by $path_url
# __USER__ by $app
# __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
# __PATH__ by $path
# __APP__ by $app
# __VAR_1__ by $var_1
# __VAR_2__ by $var_2
@ -125,7 +125,8 @@ ynh_add_config() {
#
# The helper will replace the following keywords with global variables
# 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
# __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH
#
@ -144,11 +145,11 @@ ynh_replace_vars() {
# ===========================================
# Replace specific YunoHost variables
if test -n "${path_url:-}"; then
# path_url_slash_less is path_url, or a blank value if path_url is only '/'
local path_url_slash_less=${path_url%/}
ynh_replace_string --match_string="__PATH__/" --replace_string="$path_url_slash_less/" --target_file="$file"
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$file"
if test -n "${path:-}"; then
# path_slash_less is path, or a blank value if path is only '/'
local path_slash_less=${path%/}
ynh_replace_string --match_string="__PATH__/" --replace_string="$path_slash_less/" --target_file="$file"
ynh_replace_string --match_string="__PATH__" --replace_string="$path" --target_file="$file"
fi
if test -n "${app:-}"; then
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)
#
# 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: key2=value2 - (Optionnal) Another POST key and corresponding value
# | 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
#
# `$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.
ynh_local_curl() {
# Define url of page to curl
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
fi