From c2d5e2f7496ac4d5227c9669a80e306bc45f70c4 Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 2 May 2022 22:23:35 +0200 Subject: [PATCH] Use DB path when checking timestamps in repo cleanup Otherwise it can break if files DBs are used. --- librepomgr/buildactions/repomanagement.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/librepomgr/buildactions/repomanagement.cpp b/librepomgr/buildactions/repomanagement.cpp index 6f10c66..856d809 100644 --- a/librepomgr/buildactions/repomanagement.cpp +++ b/librepomgr/buildactions/repomanagement.cpp @@ -1,3 +1,5 @@ +#define CPP_UTILITIES_PATHHELPER_STRING_VIEW + #include "./buildactionprivate.h" #include "../logging.h" @@ -587,7 +589,7 @@ void CleanRepository::run() auto parentPath = std::filesystem::path(); try { auto archSpecificPath = std::filesystem::canonical(db->localPkgDir); - const auto dbFile = argsToString(archSpecificPath, '/', db->name + ".db"); + const auto dbFile = argsToString(archSpecificPath, '/', !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 ("