Blame SOURCES/0011-Revert-Fix-modular-queries-with-the-new-solver.patch

2e24b4
From 83703689de978cbb5e38f04fb1d9f554026de5ba 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 11/19] Revert "Fix modular queries with the new solver"
2e24b4
2e24b4
This reverts commit a9f99a4969831f5d0e21d0f2b2b088ff6546604b.
2e24b4
---
2e24b4
 libdnf/module/ModulePackage.cpp          | 17 ++++-------------
2e24b4
 libdnf/module/ModulePackageContainer.cpp | 13 ++-----------
2e24b4
 libdnf/module/ModulePackageContainer.hpp |  2 +-
2e24b4
 3 files changed, 7 insertions(+), 25 deletions(-)
2e24b4
2e24b4
diff --git a/libdnf/module/ModulePackage.cpp b/libdnf/module/ModulePackage.cpp
2e24b4
index d644eca6..63ee1656 100644
2e24b4
--- a/libdnf/module/ModulePackage.cpp
2e24b4
+++ b/libdnf/module/ModulePackage.cpp
2e24b4
@@ -52,7 +52,7 @@ namespace libdnf {
2e24b4
  *   Provides: module($name:$stream)
2e24b4
  */
2e24b4
 static void setSovable(Pool * pool, Solvable * solvable, const std::string & name,
2e24b4
-    const std::string & stream, const std::string & version, const std::string & context, const char * arch, const std::string & original_context)
2e24b4
+    const std::string & stream, const std::string & version, const std::string & context, const char * arch)
2e24b4
 {
2e24b4
     std::ostringstream ss;
2e24b4
     //   Name: $name:$stream:$context
2e24b4
@@ -62,14 +62,6 @@ static void setSovable(Pool * pool, Solvable * solvable, const std::string & nam
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
-    // store original context in summary
2e24b4
-    solvable_set_str(solvable, SOLVABLE_SUMMARY, original_context.c_str());
2e24b4
-
2e24b4
-    // store original name:stream in description
2e24b4
-    ss.str(std::string());
2e24b4
-    ss << name << ":" << stream;
2e24b4
-    solvable_set_str(solvable, SOLVABLE_DESCRIPTION, ss.str().c_str());
2e24b4
-
2e24b4
     // create Provide: module($name)
2e24b4
     ss.str(std::string());
2e24b4
     ss << "module(" << name << ")";
2e24b4
@@ -105,9 +97,8 @@ ModulePackage::ModulePackage(DnfSack * moduleSack, LibsolvRepo * repo,
2e24b4
     Pool * pool = dnf_sack_get_pool(moduleSack);
2e24b4
     id = repo_add_solvable(repo);
2e24b4
     Solvable *solvable = pool_id2solvable(pool, id);
2e24b4
-    std::string original_context = getContext();
2e24b4
-    setSovable(pool, solvable, getName(), getStream(), getVersion(), context.empty() ? original_context : context,
2e24b4
-               getArchCStr(), original_context);
2e24b4
+
2e24b4
+    setSovable(pool, solvable, getName(), getStream(), getVersion(), context.empty() ? getContext() : context, getArchCStr());
2e24b4
     createDependencies(solvable);
2e24b4
     HyRepo hyRepo = static_cast<HyRepo>(repo->appdata);
2e24b4
     libdnf::repoGetImpl(hyRepo)->needs_internalizing = 1;
2e24b4
@@ -649,7 +640,7 @@ ModulePackage::createPlatformSolvable(DnfSack * sack, DnfSack * moduleSack,
2e24b4
     repoImpl->needs_internalizing = 1;
2e24b4
     Id id = repo_add_solvable(repo);
2e24b4
     Solvable *solvable = pool_id2solvable(pool, id);
2e24b4
-    setSovable(pool, solvable, name, stream, version, context, "noarch", context);
2e24b4
+    setSovable(pool, solvable, name, stream, version, context, "noarch");
2e24b4
     repoImpl->needs_internalizing = 1;
2e24b4
     dnf_sack_set_provides_not_ready(moduleSack);
2e24b4
     dnf_sack_set_considered_to_update(moduleSack);
2e24b4
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
2e24b4
index 6ee2b68f..3f30037e 100644
2e24b4
--- a/libdnf/module/ModulePackageContainer.cpp
2e24b4
+++ b/libdnf/module/ModulePackageContainer.cpp
2e24b4
@@ -197,13 +197,6 @@ private:
2e24b4
     class ModulePersistor;
2e24b4
     std::unique_ptr<ModulePersistor> persistor;
2e24b4
     std::map<Id, std::unique_ptr<ModulePackage>> modules;
2e24b4
-    /// Internal sack with module solvables
2e24b4
-    /// resolveContext = <moduleContext> if moduleMdVersion > 2, else generated from requires
2e24b4
-    /// solvable.name = <moduleName>:<moduleStream>:<resolveContext>
2e24b4
-    /// solvable.evr = <moduleVersion>
2e24b4
-    /// solvable.arch = <moduleArch>
2e24b4
-    /// solvable.summary = <moduleContext>
2e24b4
-    /// solvable.description = <moduleName>:<moduleStream>
2e24b4
     DnfSack * moduleSack;
2e24b4
     std::unique_ptr<PackageSet> activatedModules;
2e24b4
     std::string installRoot;
2e24b4
@@ -764,10 +757,8 @@ ModulePackageContainer::query(std::string name, std::string stream, std::string
2e24b4
     query.available();
2e24b4
     std::ostringstream ss;
2e24b4
     ss << stringFormater(name) << ":" << stringFormater(stream);
2e24b4
-    query.addFilter(HY_PKG_DESCRIPTION, HY_GLOB, ss.str().c_str());
2e24b4
-    if (!context.empty()) {
2e24b4
-        query.addFilter(HY_PKG_SUMMARY, HY_GLOB, context.c_str());
2e24b4
-    }
2e24b4
+    ss << ":" << stringFormater(context);
2e24b4
+    query.addFilter(HY_PKG_NAME, HY_GLOB, ss.str().c_str());
2e24b4
     if (!arch.empty()) {
2e24b4
         query.addFilter(HY_PKG_ARCH, HY_GLOB, arch.c_str());
2e24b4
     }
2e24b4
diff --git a/libdnf/module/ModulePackageContainer.hpp b/libdnf/module/ModulePackageContainer.hpp
2e24b4
index c1001fce..7e5071b2 100644
2e24b4
--- a/libdnf/module/ModulePackageContainer.hpp
2e24b4
+++ b/libdnf/module/ModulePackageContainer.hpp
2e24b4
@@ -270,7 +270,7 @@ public:
2e24b4
     */
2e24b4
     std::vector<ModulePackage *> query(libdnf::Nsvcap & moduleNevra);
2e24b4
     /**
2e24b4
-    * @brief Requiers subject in format <name>, <name>:<stream>, or <name>:<stream>:<contex>
2e24b4
+    * @brief Requiers subject in format <name>, <name>:<stream>, or <name>:<stream>:<version>
2e24b4
     *
2e24b4
     * @param subject p_subject:...
2e24b4
     * @return std::vector<ModulePackage *>
2e24b4
-- 
2e24b4
2.31.1
2e24b4