dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

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

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