From 92531647d980a14c22c25485cbf9b1eb7be12842 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 05 2022 05:27:04 +0000 Subject: import libdnf-0.63.0-7.el8 --- diff --git a/SOURCES/0025-Add-getLatestModules.patch b/SOURCES/0025-Add-getLatestModules.patch new file mode 100644 index 0000000..b008d6a --- /dev/null +++ b/SOURCES/0025-Add-getLatestModules.patch @@ -0,0 +1,90 @@ +From e83ff88f8e4604024e4d5f4fd9f2fa4e5d4f03f9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Mracek +Date: Tue, 23 Nov 2021 14:14:23 +0100 +Subject: [PATCH] Add getLatestModules() + +It returns latest module packages for each module name, stream, and +architecture. + +It is an alternative implementation to code base with +the old modular solver. + +Alternative to 73868368120ceea97ada628a1aa42236fb42b89d +--- + libdnf/module/ModulePackageContainer.cpp | 39 +++++++++++++++++++++++++++++++++++++++ + libdnf/module/ModulePackageContainer.hpp | 9 +++++++++ + 2 files changed, 48 insertions(+) + +diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp +index efab497..f9f861c 100644 +--- a/libdnf/module/ModulePackageContainer.cpp ++++ b/libdnf/module/ModulePackageContainer.cpp +@@ -1037,6 +1037,45 @@ ModulePackageContainer::getLatestModulesPerRepo(ModuleState moduleFilter, + return output; + } + ++std::vector ++ModulePackageContainer::getLatestModules(const std::vector modulePackages, bool activeOnly) ++{ ++ std::vector latestModules; ++ if (activeOnly) { ++ // When no active module return ++ if (!pImpl->activatedModules) { ++ return latestModules; ++ } ++ } ++ std::map> latest; ++ ++ for (auto modulePackage : modulePackages) { ++ if (activeOnly && !isModuleActive(modulePackage)) { ++ continue; ++ } ++ auto nameStreamArch = modulePackage->getNameStream(); ++ nameStreamArch.append(":"); ++ nameStreamArch.append(modulePackage->getArchCStr()); ++ auto & entries = latest[nameStreamArch]; ++ if (entries.empty()) { ++ entries.push_back(modulePackage); ++ } else { ++ auto version = (*entries.begin())->getVersionNum(); ++ if (version < modulePackage->getVersionNum()) { ++ entries.clear(); ++ entries.push_back(modulePackage); ++ } else if (version == modulePackage->getVersionNum()) { ++ entries.push_back(modulePackage); ++ } ++ } ++ } ++ for (auto & entries : latest) { ++ for (auto modulePackage : entries.second) { ++ latestModules.push_back(modulePackage); ++ } ++ } ++ return latestModules; ++} + + std::pair>, ModulePackageContainer::ModuleErrorType> + ModulePackageContainer::resolveActiveModulePackages(bool debugSolver) +diff --git a/libdnf/module/ModulePackageContainer.hpp b/libdnf/module/ModulePackageContainer.hpp +index 7e5071b..42d5a9e 100644 +--- a/libdnf/module/ModulePackageContainer.hpp ++++ b/libdnf/module/ModulePackageContainer.hpp +@@ -132,6 +132,15 @@ public: + std::vector>> getLatestModulesPerRepo( + ModuleState moduleFilter, std::vector modulePackages); + ++ /** ++ * @brief Return all latest ModulePackages for each module Name, stream and architecture. In case of ++ * multiple latest packages, all will be returned. When activeOnly is true, it returns only the latest active ++ * packages. ++ * ++ * @return std::vector ++ */ ++ std::vector getLatestModules(const std::vector modulePackages, bool activeOnly); ++ + std::vector requiresModuleEnablement(const libdnf::PackageSet & packages); + + /** +-- +libgit2 1.1.0 + diff --git a/SPECS/libdnf.spec b/SPECS/libdnf.spec index 51117cc..131c72b 100644 --- a/SPECS/libdnf.spec +++ b/SPECS/libdnf.spec @@ -56,7 +56,7 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 5%{?dist} +Release: 7%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf @@ -85,6 +85,7 @@ Patch21: 0021-covscan-remove-unused-vars-mark-private-func-static-return- Patch22: 0022-hawkey-surrogateescape-error-handler-to-decode-UTF-8-strings-RhBug1893176.patch Patch23: 0023-Turn-off-strict-validation-of-modulemd-documents-RhBug200485320071662007167.patch Patch24: 0024-Add-unittest-for-setting-up-repo-with-empty-keyfile-RhBug1994614.patch +Patch25: 0025-Add-getLatestModules.patch BuildRequires: cmake BuildRequires: gcc @@ -329,6 +330,12 @@ popd %endif %changelog +* Fri Jan 14 2022 Pavla Kratochvilova - 0.63.0-7 +- Rebuild with new release number + +* Tue Jan 11 2022 Pavla Kratochvilova - 0.63.0-6 +- Add getLatestModules() + * Mon Nov 29 2021 Pavla Kratochvilova - 0.63.0-5 - Add unittest for setting up repo with empty keyfile (RhBug:1994614)