From 893a8473adfa2d4c9877eaad05695d2f7592c2d7 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 3 Nov 2021 16:06:16 +0100 Subject: [PATCH] Override existing symlinks when adding packages to repo --- librepomgr/buildactions/conductbuild.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/librepomgr/buildactions/conductbuild.cpp b/librepomgr/buildactions/conductbuild.cpp index 2e0888b..cf63cd5 100644 --- a/librepomgr/buildactions/conductbuild.cpp +++ b/librepomgr/buildactions/conductbuild.cpp @@ -1103,9 +1103,7 @@ void ConductBuild::addPackageToRepo( } std::filesystem::copy(binaryPackage.path, anyRepoPath / binaryPackage.fileName, std::filesystem::copy_options::overwrite_existing); const auto symlink = std::filesystem::path(*buildResult.repoPath % '/' + binaryPackage.fileName); - if (std::filesystem::exists(symlink) && !std::filesystem::is_symlink(symlink)) { - std::filesystem::remove(symlink); - } + std::filesystem::remove(symlink); std::filesystem::create_symlink("../any/" + binaryPackage.fileName, symlink); } } catch (const std::filesystem::filesystem_error &e) {