From e1dfc99417574478af150ce1a2c29b24cdd4e372 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 25 Jul 2024 19:10:34 -0400 Subject: [PATCH] fix: remove FileLoader symlink unconditionally (#762) ### Briefly, what does this PR introduce? This PR modifies the FileLoader to remove the hash symlink unconditionally, whether broken or not. This should fix an issue where the symlink exists, points to another symlink, and that is a dead link. ### What kind of change does this PR introduce? - [x] Bug fix (issue: permission denied error) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- src/FileLoaderHelper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FileLoaderHelper.h b/src/FileLoaderHelper.h index 0563881aa..669bd2bf1 100644 --- a/src/FileLoaderHelper.h +++ b/src/FileLoaderHelper.h @@ -75,8 +75,8 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri return; } - if (fs::exists(fs::symlink_status(hash_path)) && !fs::exists(fs::status(hash_path))) { - printout(INFO, "FileLoader", "removing broken \"" + hash_path.string() + "\" symlink"); + if (fs::exists(fs::symlink_status(hash_path))) { + printout(INFO, "FileLoader", "removing symlink \"" + hash_path.string() + "\""); remove(hash_path); }