diff --git a/scripts/install b/scripts/install index 61828ba..f947727 100755 --- a/scripts/install +++ b/scripts/install @@ -69,6 +69,13 @@ db_pwd=$(ynh_app_setting_get $app mysqlpwd) #================================================= ynh_app_setting_set $app final_path $final_path + +# In case of a new version, the url change from http://download.dotclear.org/latest/dotclear-X.X.X.tar.gz to http://download.dotclear.org/attic/dotclear-X.X.X.tar.gz +src_url=$(grep 'SOURCE_URL=' "../conf/app.src" | cut -d= -f2-) +if ! curl --output /dev/null --silent --head --fail "$src_url"; then + ynh_replace_string "latest" "attic" ../conf/app.src +fi + ynh_setup_source $final_path mv $final_path/dotclear/* $final_path/ diff --git a/scripts/upgrade b/scripts/upgrade index 9302134..7220bb8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,6 +88,12 @@ ynh_backup_if_checksum_is_different "$php_config" ynh_secure_remove "$final_path" # Download, check integrity, uncompress and patch the source from app.src +# In case of a new version, the url change from http://download.dotclear.org/latest/dotclear-X.X.X.tar.gz to http://download.dotclear.org/attic/dotclear-X.X.X.tar.gz +src_url=$(grep 'SOURCE_URL=' "../conf/app.src" | cut -d= -f2-) +if ! curl --output /dev/null --silent --head --fail "$src_url"; then + ynh_replace_string "latest" "attic" ../conf/app.src +fi + ynh_setup_source "$final_path" mv $final_path/dotclear/* $final_path/