From 55aa09e9c2d6c8b3cef6245c1fb326b6a3d1491a Mon Sep 17 00:00:00 2001 From: Salamandar <6552989+Salamandar@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:21:19 +0200 Subject: [PATCH] Fix upgrade script for old versions (#102) We moved from /home/yunohost.transmission to /home/yunohost.app/transmission. Dangling symlinks might exist in the $MEDIA_DIRECTORY... Removing this before ynh_multimedia_build_main_dir will fix this, and the symlinks will be recreated after by ynh_multimedia_addfolder. Also, we're using rm and not ynh_secure_remove because of https://github.com/YunoHost/issues/issues/2253 --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 0b00e23..7ae5caa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,6 +79,11 @@ fi #================================================= ynh_script_progression --message="Adding multimedia directories..." --weight=3 +# Remove possibly dangling symlinks created before the /home/yunohost.transmission -> /home/yunohost.app/transmission transition +# Use rm because ynh_secure_remove fails on dangling symlinks, see https://github.com/YunoHost/issues/issues/2253... +rm "$MEDIA_DIRECTORY/share/Torrents" +rm "$MEDIA_DIRECTORY/share/Torrent to download" + ynh_multimedia_build_main_dir # Set rights on transmission directory (parent need to be readable by other, and progress need to be writable by multimedia. Because files will move)