richardphibel / rpms / libdnf

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