From 08421fa7197f7f6cb82e06532cf8daa67cf77293 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 7 Apr 2022 21:35:05 +0200 Subject: [PATCH] Don't rely on local pkg dir when reloading library deps Since 11f1849fdef the cache dir is also set as local pkg dir so we cannot rely on packages really existing there. --- librepomgr/buildactions/reloadlibrarydependencies.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/librepomgr/buildactions/reloadlibrarydependencies.cpp b/librepomgr/buildactions/reloadlibrarydependencies.cpp index 138cb5b..56cfb9c 100644 --- a/librepomgr/buildactions/reloadlibrarydependencies.cpp +++ b/librepomgr/buildactions/reloadlibrarydependencies.cpp @@ -178,8 +178,8 @@ bool ReloadLibraryDependencies::addRelevantPackage(LibPkg::StorageID packageID, std::error_code ec; const auto &fileName = packageInfo->fileName; const auto &arch = packageInfo->arch; - if (!db->localPkgDir.empty()) { - path = db->localPkgDir % '/' + fileName; + if (!db->localPkgDir.empty() && std::filesystem::file_size(cachePath = db->localPkgDir % '/' + fileName, ec) && !ec) { + path = std::move(cachePath); } else if (std::filesystem::file_size(cachePath = m_cacheDir + fileName, ec) && !ec) { path = std::move(cachePath); } else if (std::filesystem::file_size(cachePath = m_cacheDir % arch % '/' + fileName, ec) && !ec) {