From 13d4e16e7de7deab1d4a9e606f5b4ea7b8ebbc0b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 3 Feb 2023 02:25:36 +0100 Subject: [PATCH] helpers/appsv2: replacement of __PHPVERSION__ should use the phpversion setting, not YNH_PHP_VERSION --- helpers/utils | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helpers/utils b/helpers/utils index cd3b1b8d2..a0efa2c45 100644 --- a/helpers/utils +++ b/helpers/utils @@ -348,7 +348,7 @@ ynh_local_curl() { # __NAMETOCHANGE__ by $app # __USER__ by $app # __FINALPATH__ by $final_path -# __PHPVERSION__ by $YNH_PHP_VERSION +# __PHPVERSION__ by $YNH_PHP_VERSION (packaging v1 only, packaging v2 uses phpversion setting implicitly set by apt resource) # __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH # ``` # And any dynamic variables that should be defined before calling this helper like: @@ -417,7 +417,7 @@ ynh_add_config() { # __NAMETOCHANGE__ by $app # __USER__ by $app # __FINALPATH__ by $final_path -# __PHPVERSION__ by $YNH_PHP_VERSION +# __PHPVERSION__ by $YNH_PHP_VERSION (packaging v1 only, packaging v2 uses phpversion setting implicitly set by apt resource) # __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH # # And any dynamic variables that should be defined before calling this helper like: @@ -452,7 +452,8 @@ ynh_replace_vars() { ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$file" ynh_replace_string --match_string="__INSTALL_DIR__" --replace_string="$final_path" --target_file="$file" fi - if test -n "${YNH_PHP_VERSION:-}"; then + # Legacy / Packaging v1 only + if dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} lt 2 && test -n "${YNH_PHP_VERSION:-}"; then ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$file" fi if test -n "${ynh_node_load_PATH:-}"; then