diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-11-03 13:54:26 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-11-13 18:31:47 +0100 |
commit | 04e2f0aa0ccfe4f39c5f6c713bde182c6b7704dd (patch) | |
tree | f3281cfd6144af321866208de80036c13a47e7c5 /src/buildtool/graph_traverser/graph_traverser.hpp | |
parent | 3f279bbd68d70b7a0cf1ffa129e4f287e5a9f42e (diff) | |
download | justbuild-04e2f0aa0ccfe4f39c5f6c713bde182c6b7704dd.tar.gz |
bugfix: Also unlink symlinks before installing
Make sure that all CopyFile, WriteFile, and CreateSymlink
functions properly unlink the target file (if it exists and
overwrite requested) to avoid interferences of the install
command. With this change, the clean up step for install-cas
and the within GraphTraverser can new be omitted.
Diffstat (limited to 'src/buildtool/graph_traverser/graph_traverser.hpp')
-rw-r--r-- | src/buildtool/graph_traverser/graph_traverser.hpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/buildtool/graph_traverser/graph_traverser.hpp b/src/buildtool/graph_traverser/graph_traverser.hpp index df5fa65f..0eee1a80 100644 --- a/src/buildtool/graph_traverser/graph_traverser.hpp +++ b/src/buildtool/graph_traverser/graph_traverser.hpp @@ -522,15 +522,7 @@ class GraphTraverser { std::vector<std::filesystem::path> output_paths{}; output_paths.reserve(rel_paths.size()); for (auto const& rel_path : rel_paths) { - auto output_path = clargs_.stage->output_dir / rel_path; - if (FileSystemManager::IsFile(output_path) and - not FileSystemManager::RemoveFile(output_path)) { - Logger::Log(LogLevel::Error, - "Could not clean output path {}", - output_path.string()); - return std::nullopt; - } - output_paths.emplace_back(std::move(output_path)); + output_paths.emplace_back(clargs_.stage->output_dir / rel_path); } return output_paths; } |