1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

Move `galleries directory to /home/yunohost.app, and avoid deleting it during upgrade (fixes #26)

This commit is contained in:
Jimmy Monin 2018-07-31 21:35:38 +02:00
parent c953495b53
commit 37bdda0d8b
2 changed files with 11 additions and 11 deletions

View file

@ -104,14 +104,16 @@ ynh_system_user_create $app # Create a dedicated system user
# Install files and set permissions
mkdir $final_path
cp -a $tmpdir/!(upload|_data) $final_path
cp -a $tmpdir/!(upload|_data|galleries) $final_path
datapath=/home/yunohost.app/$app
mkdir -p $datapath/_data
mkdir -p $datapath/upload
mkdir -p $datapath/galleries
ln -sd $datapath/_data $final_path/_data
ln -sd $datapath/upload $final_path/upload
ln -sd $datapath/galleries $final_path/galleries
chown -R $app: $final_path
chown -R $app: $datapath

View file

@ -128,17 +128,8 @@ ynh_system_user_create $app # Create dedicated user if not existing
# We store photos (potentially large data) on /home/yunohost.app
datapath=/home/yunohost.app/$app
# Backward compatibility:
# If the galleries subdirectory was moved,
# remove the link and overwrite it
# (this directory always includes only a single index.php file...)
if [ -h $final_path/galleries ] ; then
rm -f $final_path/galleries # only a symbolic link, ynh_secure_remove can't handle that
ynh_secure_remove $datapath/galleries
fi
# Install files and set permissions
cp -a $tmpdir/!(upload|_data) $final_path
cp -a $tmpdir/!(upload|_data|galleries) $final_path
# Backward compatibility:
@ -149,6 +140,13 @@ if [ ! -h $final_path/_data ] ; then
ln -sd $datapath/_data $final_path/_data
fi
# Backward compatibility:
# If the galleries subdirectory wasn't already moved to /home/yunohost.app/$app,
# then move it there
if [ ! -h $final_path/galleries ] ; then
mv $final_path/galleries $datapath
ln -sd $datapath/galleries $final_path/galleries
fi
chown -R $app: $final_path
chown -R $app: $datapath