Blame SOURCES/0004-Revert-Remove-unused-code-bump-version.patch

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