1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dotclear2_ynh.git synced 2024-09-03 18:26:29 +02:00

check url and change it if not valid

This commit is contained in:
Kay0u 2019-09-08 01:33:05 +02:00
parent e82418bfb4
commit 5ab8b49bcb
No known key found for this signature in database
GPG key ID: ABC3F52576D011D3
2 changed files with 13 additions and 0 deletions

View file

@ -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/

View file

@ -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/