Fix using files DB in CleanRepository

This commit is contained in:
Martchus 2022-05-07 01:59:14 +02:00
parent c2d5e2f749
commit 5a6d68b318
1 changed files with 4 additions and 1 deletions

View File

@ -589,7 +589,10 @@ void CleanRepository::run()
auto parentPath = std::filesystem::path();
try {
auto archSpecificPath = std::filesystem::canonical(db->localPkgDir);
const auto dbFile = argsToString(archSpecificPath, '/', !db->path.empty() ? fileName(std::string_view(db->path)) : (db->name + ".db"));
const auto dbFile = argsToString(archSpecificPath, '/',
m_setup.building.loadFilesDbs && !db->filesPath.empty()
? fileName(std::string_view(db->filesPath))
: (!db->path.empty() ? fileName(std::string_view(db->path)) : (db->name + ".db")));
const auto lastModified = LibPkg::lastModified(dbFile);
if (lastModified != db->lastUpdate) {
m_messages.errors.emplace_back("The db file's last modification (" % lastModified.toString() % ") does not match the last db update ("