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

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