From 10457c58935c5ee758c0ce6721ae1895d66146fa Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 7 Mar 2019 20:05:03 +0100 Subject: [PATCH 1/2] Normalizing url ain't needed anymore --- scripts/change_url | 9 --------- scripts/install | 3 --- scripts/upgrade | 7 ------- 3 files changed, 19 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 93a67da..7b500d3 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -33,15 +33,6 @@ final_path=$(ynh_app_setting_get $app final_path) #db_name=$(ynh_app_setting_get "$app" db_name) #db_pwd=$(ynh_app_setting_get $app db_pwd) -#================================================= -# CHECK THE SYNTAX OF THE PATHS -#================================================= - -test -n "$old_path" || old_path="/" -test -n "$new_path" || new_path="/" -new_path=$(ynh_normalize_url_path $new_path) -old_path=$(ynh_normalize_url_path $old_path) - #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= diff --git a/scripts/install b/scripts/install index 1f0eb0d..ec3811a 100755 --- a/scripts/install +++ b/scripts/install @@ -53,9 +53,6 @@ ynh_print_info "Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" -# Normalize the url path syntax -path_url=$(ynh_normalize_url_path $path_url) - # Register (book) web path ynh_webpath_register $app $domain $path_url diff --git a/scripts/upgrade b/scripts/upgrade index 4b4393b..120ce25 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,13 +64,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= From 3f2a78ea0bb18dc950e7bf27c00c39620b836ae5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 7 Mar 2019 22:44:41 +0100 Subject: [PATCH 2/2] Put back normalization in update script with a note about YunoHost 2.7 --- scripts/upgrade | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 120ce25..9de0b41 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,6 +64,18 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# CHECK THE PATH +#================================================= + +# Normalize the URL path syntax +# N.B. : this is for app installations before YunoHost 2.7 +# where this value might be something like /foo/ or foo/ +# instead of /foo .... +# If nobody installed your app before 2.7, then you may +# safely remove this line +path_url=$(ynh_normalize_url_path $path_url) + #================================================= # STANDARD UPGRADE STEPS #=================================================