From 307322ab11dd1535644429c592ec8d767d0b447d Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 15 Mar 2021 18:27:04 +0100 Subject: [PATCH] Handle signatures when cleaning up repository --- librepomgr/buildactions/repomanagement.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/librepomgr/buildactions/repomanagement.cpp b/librepomgr/buildactions/repomanagement.cpp index 0d8ee4f..eed6d78 100644 --- a/librepomgr/buildactions/repomanagement.cpp +++ b/librepomgr/buildactions/repomanagement.cpp @@ -707,6 +707,14 @@ void CleanRepository::run() continue; } + // delete orphaned signatures, otherwise skip signatures as they are handled alongside the related package + if (fileName.ends_with(".sig")) { + if (!std::filesystem::exists(dirInfo.canonicalPath / std::string_view(fileName.data(), fileName.data() + fileName.size() - 4))) { + dirInfo.toDelete.emplace_back(fileName); + } + continue; + } + // determine package name from file name const auto [packageName, error] = [&fileName] { try {