diff options
| author | Dan Engelbrecht <[email protected]> | 2025-12-17 10:55:00 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-12-17 10:55:00 +0100 |
| commit | cc3c06713207e791f4b700acfa441116f2718d67 (patch) | |
| tree | b3ca04347938ac93baa6c85a9866825da943e00f | |
| parent | 5.7.15-pre0 (diff) | |
| download | zen-cc3c06713207e791f4b700acfa441116f2718d67.tar.xz zen-cc3c06713207e791f4b700acfa441116f2718d67.zip | |
fix scavenge source path match (again) (#694)
* fix check for scavenged path matching target path
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenremotestore/builds/buildstorageoperations.cpp | 23 |
2 files changed, 13 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ca6008244..1ba91f439 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - `--boost-worker-count` - Increase the number of worker threads - may cause computer to be less responsive - `--boost-worker-memory` - Increase the limit where we write downloaded data to temporary storage to conserve space - may cause computer to be less responsive due to high memory usage - `--boost-workers` - Enables both 'boost-worker-count' and 'boost-worker-memory' - may cause computer to be less responsive +- Bugfix: Fixed warning due to calling std::filesystem::equivalent on a non-existing path (again) ## 5.7.14 - Improvement: asio http server now supports the `--dedicated` option which prevents port remapping diff --git a/src/zenremotestore/builds/buildstorageoperations.cpp b/src/zenremotestore/builds/buildstorageoperations.cpp index 6c370f975..f07f410ea 100644 --- a/src/zenremotestore/builds/buildstorageoperations.cpp +++ b/src/zenremotestore/builds/buildstorageoperations.cpp @@ -2699,6 +2699,8 @@ BuildsOperationUpdateFolder::FindScavengeSources() { ZEN_TRACE_CPU("FindScavengeSources"); + const bool TargetPathExists = IsDir(m_Path); + std::vector<std::filesystem::path> StatePaths = GetDownloadedStatePaths(m_Options.SystemRootDir); std::vector<ScavengeSource> Result; @@ -2710,19 +2712,18 @@ BuildsOperationUpdateFolder::FindScavengeSources() try { - BuildsDownloadInfo Info = ReadDownloadedInfoFile(EntryPath); - if (!Info.LocalPath.empty() || !IsDir(Info.LocalPath)) + BuildsDownloadInfo Info = ReadDownloadedInfoFile(EntryPath); + const bool LocalPathExists = !Info.LocalPath.empty() && IsDir(Info.LocalPath); + const bool LocalStateFileExists = IsFile(Info.StateFilePath); + if (LocalPathExists && LocalStateFileExists) { - if (!std::filesystem::equivalent(Info.LocalPath, m_Path)) + if (TargetPathExists && std::filesystem::equivalent(Info.LocalPath, m_Path)) { - if (IsDir(Info.LocalPath) && IsFile(Info.StateFilePath)) - { - Result.push_back({.StateFilePath = std::move(Info.StateFilePath), .Path = std::move(Info.LocalPath)}); - } - else - { - DeleteEntry = true; - } + DeleteEntry = true; + } + else + { + Result.push_back({.StateFilePath = std::move(Info.StateFilePath), .Path = std::move(Info.LocalPath)}); } } else |