richardphibel / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

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

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