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 /src | |
| 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
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenremotestore/builds/buildstorageoperations.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
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 |