libdnf/SOURCES/0004-Revert-Remove-unused-code-bump-version.patch
2021-10-08 12:36:45 +00:00

40 lines
1.5 KiB
Diff

From 291f0393b54b31228c7a4c8c112003b64632967b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:52 +0200
Subject: [PATCH 04/19] Revert "Remove unused code bump version"
This reverts commit f0fde46c42f2424135617b29fdfbcbf9e17fc79a.
---
libdnf/module/ModulePackageContainer.cpp | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index edb7e9ec..1bfdd8c1 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -1014,6 +1014,21 @@ modulePackageLatestPerRepoSorter(DnfSack * sack, const ModulePackage * first, co
return first->getVersionNum() > second->getVersionNum();
}
+static bool
+modulePackageLatestSorter(DnfSack * sack, const ModulePackage * first, const ModulePackage * second)
+{
+ int cmp = g_strcmp0(first->getNameCStr(), second->getNameCStr());
+ if (cmp != 0)
+ return cmp < 0;
+ cmp = dnf_sack_evr_cmp(sack, first->getStreamCStr(), second->getStreamCStr());
+ if (cmp != 0)
+ return cmp < 0;
+ cmp = g_strcmp0(first->getArchCStr(), second->getArchCStr());
+ if (cmp != 0)
+ return cmp < 0;
+ return first->getVersionNum() > second->getVersionNum();
+}
+
std::vector<std::vector<std::vector<ModulePackage *>>>
ModulePackageContainer::getLatestModulesPerRepo(ModuleState moduleFilter,
std::vector<ModulePackage *> modulePackages)
--
2.31.1