mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
fix upgrade
This commit is contained in:
parent
2b81bf7731
commit
4e130d43e1
1 changed files with 26 additions and 23 deletions
|
@ -107,13 +107,13 @@ then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=3
|
ynh_script_progression --message="Upgrading source files..." --weight=3
|
||||||
|
|
||||||
# Create tmp directory and fetch app inside
|
# Create tmp directory and fetch app inside
|
||||||
tmpdir="$(ynh_smart_mktemp --min_size=300)"
|
tmpdir="$(ynh_smart_mktemp --min_size=300)"
|
||||||
ynh_setup_source --dest_dir="$tmpdir"
|
ynh_setup_source --dest_dir="$tmpdir"
|
||||||
|
|
||||||
# Fetch needed plugins
|
# Fetch needed plugins
|
||||||
mkdir -p $tmpdir/plugins/Ldap_Login
|
mkdir -p $tmpdir/plugins/Ldap_Login
|
||||||
ynh_setup_source --dest_dir="$tmpdir/plugins/Ldap_Login" --source_id=ldap_plugin
|
ynh_setup_source --dest_dir="$tmpdir/plugins/Ldap_Login" --source_id=ldap_plugin
|
||||||
ynh_setup_source --dest_dir="$tmpdir/plugins" --source_id=log_failed_logins_plugin
|
ynh_setup_source --dest_dir="$tmpdir/plugins" --source_id=log_failed_logins_plugin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -158,31 +158,34 @@ shopt -s extglob
|
||||||
|
|
||||||
datapath=/home/yunohost.app/$app
|
datapath=/home/yunohost.app/$app
|
||||||
|
|
||||||
# Install files and set permissions
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
cp -a $tmpdir/!(upload|_data|galleries) $final_path
|
then
|
||||||
|
# Install files and set permissions
|
||||||
|
cp -a $tmpdir/!(upload|_data|galleries) $final_path
|
||||||
|
|
||||||
# Backward compatibility:
|
# Backward compatibility:
|
||||||
# If the _data subdirectory wasn't already moved to /home/yunohost.app/$app,
|
# If the _data subdirectory wasn't already moved to /home/yunohost.app/$app,
|
||||||
# then move it there
|
# then move it there
|
||||||
if [ ! -h $final_path/_data ] ; then
|
if [ ! -h $final_path/_data ] ; then
|
||||||
mv $final_path/_data $datapath
|
mv $final_path/_data $datapath
|
||||||
ln -sd $datapath/_data $final_path/_data
|
ln -sd $datapath/_data $final_path/_data
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Backward compatibility:
|
# Backward compatibility:
|
||||||
# If the galleries subdirectory wasn't already moved to /home/yunohost.app/$app,
|
# If the galleries subdirectory wasn't already moved to /home/yunohost.app/$app,
|
||||||
# then move it there
|
# then move it there
|
||||||
if [ ! -h $final_path/galleries ] ; then
|
if [ ! -h $final_path/galleries ] ; then
|
||||||
mv $final_path/galleries $datapath
|
mv $final_path/galleries $datapath
|
||||||
ln -sd $datapath/galleries $final_path/galleries
|
ln -sd $datapath/galleries $final_path/galleries
|
||||||
|
fi
|
||||||
|
|
||||||
|
ynh_secure_remove --file="$tmpdir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
chown -R $app: $datapath
|
chown -R $app: $datapath
|
||||||
chmod 755 -R $final_path/_data
|
chmod 755 -R $final_path/_data
|
||||||
|
|
||||||
ynh_secure_remove --file="$tmpdir"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE APPLICATION WITH CURL
|
# UPGRADE APPLICATION WITH CURL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue