chantra / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0015-Revert-Change-usage-of-context-and-version-in-modula.patch

379fd8
From 50aa9f29dbfc1523a3b6aea41c6caa37f30c1bf0 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:53 +0200
379fd8
Subject: [PATCH 15/19] Revert "Change usage of context and version in modular
379fd8
 solver"
379fd8
379fd8
This reverts commit 1f4c5b2a37ec333b23a12b882b046fac858155aa.
379fd8
---
379fd8
 libdnf/module/ModulePackage.cpp | 28 ++++++++++++++--------------
379fd8
 1 file changed, 14 insertions(+), 14 deletions(-)
379fd8
379fd8
diff --git a/libdnf/module/ModulePackage.cpp b/libdnf/module/ModulePackage.cpp
379fd8
index 8126bcaa..eea4a8b5 100644
379fd8
--- a/libdnf/module/ModulePackage.cpp
379fd8
+++ b/libdnf/module/ModulePackage.cpp
379fd8
@@ -43,25 +43,19 @@ extern "C" {
379fd8
 
379fd8
 namespace libdnf {
379fd8
 
379fd8
-    /**
379fd8
-     * @brief create solvable with:
379fd8
-     *   Name: $name:$stream:$context
379fd8
-     *   Version: $version
379fd8
-     *   Arch: $arch (If arch is not defined, set "noarch")
379fd8
-     *   Provides: module($name)
379fd8
-     *   Provides: module($name:$stream)
379fd8
-     */
379fd8
-    static void setSovable(Pool * pool, Solvable *solvable, std::string & name,
379fd8
-    std::string & stream, std::string & version, std::string & context, const char * arch)
379fd8
+static void setSovable(Pool * pool, Solvable *solvable, std::string name,
379fd8
+    std::string stream, std::string version, std::string context, const char * arch)
379fd8
 {
379fd8
     std::ostringstream ss;
379fd8
-    //   Name: $name:$stream:$context
379fd8
-    ss << name << ":" << stream << ":" << context;
379fd8
+    // create solvable with:
379fd8
+    //   Name: $name:$stream:$version:$context
379fd8
+    //   Version: 0
379fd8
+    //   Arch: $arch
379fd8
+    ss << name << ":" << stream << ":" << version << ":" << context;
379fd8
     solvable_set_str(solvable, SOLVABLE_NAME, ss.str().c_str());
379fd8
-    solvable_set_str(solvable, SOLVABLE_EVR, version.c_str());
379fd8
+    solvable_set_str(solvable, SOLVABLE_EVR, "0");
379fd8
     // TODO Test can be remove when modules will be always with arch
379fd8
     solvable_set_str(solvable, SOLVABLE_ARCH, arch ? arch : "noarch");
379fd8
-
379fd8
     // create Provide: module($name)
379fd8
     ss.str(std::string());
379fd8
     ss << "module(" << name << ")";
379fd8
@@ -73,6 +67,12 @@ namespace libdnf {
379fd8
     ss << "module(" << name << ":" << stream << ")";
379fd8
     depId = pool_str2id(pool, ss.str().c_str(), 1);
379fd8
     solvable_add_deparray(solvable, SOLVABLE_PROVIDES, depId, -1);
379fd8
+
379fd8
+    // create Provide: module($name:$stream:$version)
379fd8
+    ss.str(std::string());
379fd8
+    ss << "module(" << name << ":" << stream << ":" << version << ")";
379fd8
+    depId = pool_str2id(pool, ss.str().c_str(), 1);
379fd8
+    solvable_add_deparray(solvable, SOLVABLE_PROVIDES, depId, -1);
379fd8
 }
379fd8
 
379fd8
 
379fd8
-- 
379fd8
2.31.1
379fd8