Auto sync2gitlab import of libdnf-0.63.0-8.el8.src.rpm

This commit is contained in:
James Antill 2022-05-26 10:30:31 -04:00
parent 7ea2f9f16f
commit baf7d8633d
30 changed files with 8450 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/libdnf-0.63.0.tar.gz

View File

@ -0,0 +1,32 @@
From 293e10c58dadc023070f959b08999b6bc2efb1b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:51 +0200
Subject: [PATCH 01/19] Revert "Improve performance for module query"
This reverts commit 38942d42b6980216e5d5e2e5798664cd08deb3ba.
---
libdnf/module/ModulePackageContainer.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index 1d5070ca..edb7e9ec 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -775,11 +775,9 @@ ModulePackageContainer::query(std::string name, std::string stream, std::string
Query query(pImpl->moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
// platform modules are installed and not in modules std::Map.
query.available();
- if (!name.empty() || !stream.empty()) {
- std::ostringstream ss;
- ss << stringFormater(name) << ":" << stringFormater(stream);
- query.addFilter(HY_PKG_DESCRIPTION, HY_GLOB, ss.str().c_str());
- }
+ std::ostringstream ss;
+ ss << stringFormater(name) << ":" << stringFormater(stream);
+ query.addFilter(HY_PKG_DESCRIPTION, HY_GLOB, ss.str().c_str());
if (!context.empty()) {
query.addFilter(HY_PKG_SUMMARY, HY_GLOB, context.c_str());
}
--
2.31.1

View File

@ -0,0 +1,26 @@
From fe466856f54ed2cd261a863b2c929a064ae5e945 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:51 +0200
Subject: [PATCH 02/19] Revert "Enhance description of modular solvables"
This reverts commit 943d9a1ba905f2e10975b16edff0684964c135b6.
---
libdnf/module/ModulePackage.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/libdnf/module/ModulePackage.cpp b/libdnf/module/ModulePackage.cpp
index 3757f6ad..d0017877 100644
--- a/libdnf/module/ModulePackage.cpp
+++ b/libdnf/module/ModulePackage.cpp
@@ -50,8 +50,6 @@ namespace libdnf {
* Arch: $arch (If arch is not defined, set "noarch")
* Provides: module($name)
* Provides: module($name:$stream)
- * Summary: original_context
- * Description: name:stream
*/
static void setSovable(Pool * pool, Solvable * solvable, const std::string & name,
const std::string & stream, const std::string & version, const std::string & context, const char * arch, const std::string & original_context)
--
2.31.1

View File

@ -0,0 +1,26 @@
From adf159cce65fa5b15f81dd3ee319e551f01def1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:51 +0200
Subject: [PATCH 03/19] Revert "Fix typo: lates -> latest"
This reverts commit 2a7a315cda61355d60fc0dd0fae9ccd48079a9c5.
---
libdnf/dnf-context.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp
index 926681c2..ccb6fe83 100644
--- a/libdnf/dnf-context.cpp
+++ b/libdnf/dnf-context.cpp
@@ -3253,7 +3253,7 @@ report_problems(const std::vector<std::tuple<libdnf::ModulePackageContainer::Mod
logger->warning(tfm::format(_("Modular dependency problem with Defaults: %s"), report.c_str()));
break;
case libdnf::ModulePackageContainer::ModuleErrorType::ERROR_IN_LATEST:
- logger->warning(tfm::format(_("Modular dependency problem with the latest modules: %s"),
+ logger->warning(tfm::format(_("Modular dependency problem with the lates modules: %s"),
report.c_str()));
break;
case libdnf::ModulePackageContainer::ModuleErrorType::ERROR:
--
2.31.1

View File

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

View File

@ -0,0 +1,89 @@
From ce301450c39ebbd9fc5ec0897af2df766015e1bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 05/19] Revert "Report a new type of the module resolve error"
This reverts commit 9235436672fa413d5ac94f52a534b5abe90b5c7f.
---
libdnf/dnf-context.cpp | 4 ----
libdnf/module/ModulePackageContainer.cpp | 17 ++++++++++++-----
libdnf/module/ModulePackageContainer.hpp | 10 ++++------
3 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp
index ccb6fe83..55af2b26 100644
--- a/libdnf/dnf-context.cpp
+++ b/libdnf/dnf-context.cpp
@@ -3252,10 +3252,6 @@ report_problems(const std::vector<std::tuple<libdnf::ModulePackageContainer::Mod
case libdnf::ModulePackageContainer::ModuleErrorType::ERROR_IN_DEFAULTS:
logger->warning(tfm::format(_("Modular dependency problem with Defaults: %s"), report.c_str()));
break;
- case libdnf::ModulePackageContainer::ModuleErrorType::ERROR_IN_LATEST:
- logger->warning(tfm::format(_("Modular dependency problem with the lates modules: %s"),
- report.c_str()));
- break;
case libdnf::ModulePackageContainer::ModuleErrorType::ERROR:
logger->error(tfm::format(_("Modular dependency problem: %s"), report.c_str()));
return_error = true;
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index 1bfdd8c1..ee90056c 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -725,16 +725,23 @@ ModulePackageContainer::Impl::moduleSolve(const std::vector<ModulePackage *> & m
goal2name_query(goalWeak, query);
activatedModules.reset(new PackageSet(*query.runSet()));
}
- return make_pair(problems, problemType);
+ } else {
+ problemType = ModulePackageContainer::ModuleErrorType::ERROR_IN_DEFAULTS;
+ Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
+ goal2name_query(goal, query);
+ activatedModules.reset(new PackageSet(*query.runSet()));
}
- problemType = ModulePackageContainer::ModuleErrorType::ERROR_IN_LATEST;
} else {
problemType = ModulePackageContainer::ModuleErrorType::ERROR_IN_DEFAULTS;
+ Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
+ goal2name_query(goal, query);
+ activatedModules.reset(new PackageSet(*query.runSet()));
}
+ } else {
+ Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
+ goal2name_query(goal, query);
+ activatedModules.reset(new PackageSet(*query.runSet()));
}
- Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
- goal2name_query(goal, query);
- activatedModules.reset(new PackageSet(*query.runSet()));
return make_pair(problems, problemType);
}
diff --git a/libdnf/module/ModulePackageContainer.hpp b/libdnf/module/ModulePackageContainer.hpp
index f19c60fd..99fc0677 100644
--- a/libdnf/module/ModulePackageContainer.hpp
+++ b/libdnf/module/ModulePackageContainer.hpp
@@ -48,17 +48,15 @@ public:
enum class ModuleErrorType {
NO_ERROR = 0,
INFO,
- /// Error in module defaults detected during resolvement of module dependencies
+ /// Error in module defaults detected during resovement of module dependencies
ERROR_IN_DEFAULTS,
- /// Error detected during resolvement of module dependencies
+ /// Error detected during resovement of module dependencies
ERROR,
- /// Error detected during resolvement of module dependencies - Unexpected error!!!
+ /// Error detected during resovement of module dependencies - Unexpected error!!!
CANNOT_RESOLVE_MODULES,
CANNOT_RESOLVE_MODULE_SPEC,
CANNOT_ENABLE_MULTIPLE_STREAMS,
- CANNOT_MODIFY_MULTIPLE_TIMES_MODULE_STATE,
- /// Problem with latest modules during resolvement of module dependencies
- ERROR_IN_LATEST
+ CANNOT_MODIFY_MULTIPLE_TIMES_MODULE_STATE
};
struct Exception : public std::runtime_error
--
2.31.1

View File

@ -0,0 +1,62 @@
From 15a06ef27466f42a8dc39823385f0ca655e80b12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 06/19] Revert "Add additional fallback for module resolve"
This reverts commit fc98ce725181a77bbe0ab157d40443467612c0c0.
---
libdnf/module/ModulePackageContainer.cpp | 32 ++++++++----------------
1 file changed, 11 insertions(+), 21 deletions(-)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index ee90056c..e19db08b 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -702,33 +702,23 @@ ModulePackageContainer::Impl::moduleSolve(const std::vector<ModulePackage *> & m
std::vector<std::vector<std::string>> problems;
auto problemType = ModulePackageContainer::ModuleErrorType::NO_ERROR;
if (ret) {
- // Goal run ignor problem in defaults
problems = goal.describeAllProblemRules(false);
ret = goal.run(DNF_FORCE_BEST);
if (ret) {
- // Goal run ignor problem in defaults and in latest
- ret = goal.run(DNF_NONE);
+ // Conflicting modules has to be removed otherwice it could result than one of them will
+ // be active
+ auto conflictingPkgs = goal.listConflictPkgs(DNF_PACKAGE_STATE_AVAILABLE);
+ dnf_sack_add_excludes(moduleSack, conflictingPkgs.get());
+ ret = goalWeak.run(DNF_NONE);
if (ret) {
- // Conflicting modules has to be removed otherwice it could result than one of them will
- // be active
- auto conflictingPkgs = goal.listConflictPkgs(DNF_PACKAGE_STATE_AVAILABLE);
- dnf_sack_add_excludes(moduleSack, conflictingPkgs.get());
- ret = goalWeak.run(DNF_NONE);
- if (ret) {
- auto logger(Log::getLogger());
- logger->critical("Modularity filtering totally broken\n");
- problemType = ModulePackageContainer::ModuleErrorType::CANNOT_RESOLVE_MODULES;
- activatedModules.reset();
- } else {
- problemType = ModulePackageContainer::ModuleErrorType::ERROR;
- Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
- goal2name_query(goalWeak, query);
- activatedModules.reset(new PackageSet(*query.runSet()));
- }
+ auto logger(Log::getLogger());
+ logger->critical("Modularity filtering totally broken\n");
+ problemType = ModulePackageContainer::ModuleErrorType::CANNOT_RESOLVE_MODULES;
+ activatedModules.reset();
} else {
- problemType = ModulePackageContainer::ModuleErrorType::ERROR_IN_DEFAULTS;
+ problemType = ModulePackageContainer::ModuleErrorType::ERROR;
Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
- goal2name_query(goal, query);
+ goal2name_query(goalWeak, query);
activatedModules.reset(new PackageSet(*query.runSet()));
}
} else {
--
2.31.1

View File

@ -0,0 +1,27 @@
From 0a92554dc2df3d2241b289bb796bc997c2959aaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 07/19] Revert "Decide how to handle context according to
static_context value"
This reverts commit 66439ed5a57373dfd106379637a9400b107e160c.
---
libdnf/module/modulemd/ModuleMetadata.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdnf/module/modulemd/ModuleMetadata.cpp b/libdnf/module/modulemd/ModuleMetadata.cpp
index ee6834c6..07817ce1 100644
--- a/libdnf/module/modulemd/ModuleMetadata.cpp
+++ b/libdnf/module/modulemd/ModuleMetadata.cpp
@@ -142,7 +142,7 @@ std::vector<ModulePackage *> ModuleMetadata::getAllModulePackages(DnfSack * modu
//GPtrArray * streams = modulemd_module_index_search_streams_by_nsvca_glob(resultingModuleIndex, NULL);
for (unsigned int i = 0; i < streams->len; i++){
ModulemdModuleStream * moduleMdStream = static_cast<ModulemdModuleStream *>(g_ptr_array_index(streams, i));
- if (modulemd_module_stream_v2_is_static_context((ModulemdModuleStreamV2 *) moduleMdStream)) {
+ if (modulemd_module_stream_get_mdversion(moduleMdStream) > 2) {
result.push_back(new ModulePackage(moduleSack, repo, moduleMdStream, repoID));
} else {
g_object_ref(moduleMdStream);
--
2.31.1

View File

@ -0,0 +1,76 @@
From 140168ce29d2425ebf2b4b5b25926611a189cd84 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 08/19] Revert "Fix load/update FailSafe"
This reverts commit 244a37d772fcd5a5969085edab544fb1e7b68aad.
---
libdnf/module/ModulePackageContainer.cpp | 38 ++++++++++++++++++------
1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index e19db08b..97c84c01 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -1641,7 +1641,6 @@ ModulePackageContainer::Impl::ModulePersistor::getRemovedProfiles()
void ModulePackageContainer::loadFailSafeData()
{
- pImpl->addVersion2Modules();
auto persistor = pImpl->persistor->configs;
std::map<std::string, std::pair<std::string, bool>> enabledStreams;
@@ -1696,21 +1695,42 @@ void ModulePackageContainer::loadFailSafeData()
std::vector<ModulePackage *> ModulePackageContainer::Impl::getLatestActiveEnabledModules()
{
- Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
- query.addFilter(HY_PKG, HY_EQ, activatedModules.get());
- query.addFilter(HY_PKG_REPONAME, HY_NEQ, HY_SYSTEM_REPO_NAME);
- query.addFilter(HY_PKG_LATEST_PER_ARCH, HY_EQ, 1);
- auto set = query.runSet();
-
std::vector<ModulePackage *> activeModules;
Id moduleId = -1;
- while ((moduleId = set->next(moduleId)) != -1) {
+ while ((moduleId = activatedModules->next(moduleId)) != -1) {
auto modulePackage = modules.at(moduleId).get();
if (isEnabled(modulePackage->getName(), modulePackage->getStream())) {
activeModules.push_back(modulePackage);
}
}
- return activeModules;
+ if (activeModules.empty()) {
+ return {};
+ }
+ auto sack = moduleSack;
+ std::sort(activeModules.begin(), activeModules.end(),
+ [sack](const ModulePackage * first, const ModulePackage * second)
+ {return modulePackageLatestSorter(sack, first, second);});
+
+ auto packageFirst = activeModules[0];
+ std::vector<ModulePackage *> latest;
+ auto vectorSize = activeModules.size();
+ latest.push_back(packageFirst);
+ auto name = packageFirst->getNameCStr();
+ auto stream = packageFirst->getStreamCStr();
+ auto arch = packageFirst->getArchCStr();
+
+ for (unsigned int index = 1; index < vectorSize; ++index) {
+ auto & package = activeModules[index];
+ if (g_strcmp0(package->getNameCStr(), name) != 0 ||
+ g_strcmp0(package->getStreamCStr(), stream) != 0 ||
+ g_strcmp0(package->getArchCStr(), arch) != 0) {
+ name = package->getNameCStr();
+ stream = package->getStreamCStr();
+ arch = package->getArchCStr();
+ latest.push_back(package);
+ }
+ }
+ return latest;
}
void ModulePackageContainer::Impl::addVersion2Modules()
--
2.31.1

View File

@ -0,0 +1,78 @@
From e43ef244e78d8563eb3cb7ff6a6074946f60c877 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 09/19] Revert "Change mechanism of module conflicts"
This reverts commit 49600ba05b474bc29651aa122a9116b5ada69f4d.
---
libdnf/dnf-sack.cpp | 1 +
libdnf/module/ModulePackage.cpp | 2 --
libdnf/module/ModulePackage.hpp | 1 -
libdnf/module/ModulePackageContainer.cpp | 1 -
libdnf/module/ModulePackageContainer.hpp | 1 -
5 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp
index b5c7edc0..b9baeaef 100644
--- a/libdnf/dnf-sack.cpp
+++ b/libdnf/dnf-sack.cpp
@@ -2297,6 +2297,7 @@ void readModuleMetadataFromRepo(DnfSack * sack, libdnf::ModulePackageContainer *
modulePackages->add(sack);
modulePackages->loadFailSafeData();
if (!modulePackages->empty()) {
+ modulePackages->createConflictsBetweenStreams();
// TODO remove hard-coded path
try {
std::vector<std::string> paths{"/etc/os-release", "/usr/lib/os-release"};
diff --git a/libdnf/module/ModulePackage.cpp b/libdnf/module/ModulePackage.cpp
index d0017877..d644eca6 100644
--- a/libdnf/module/ModulePackage.cpp
+++ b/libdnf/module/ModulePackage.cpp
@@ -75,8 +75,6 @@ static void setSovable(Pool * pool, Solvable * solvable, const std::string & nam
ss << "module(" << name << ")";
auto depId = pool_str2id(pool, ss.str().c_str(), 1);
solvable_add_deparray(solvable, SOLVABLE_PROVIDES, depId, -1);
- // create Conflicts: module($name)
- solvable_add_deparray(solvable, SOLVABLE_CONFLICTS, depId, 0);
// create Provide: module($name:$stream)
ss.str(std::string());
diff --git a/libdnf/module/ModulePackage.hpp b/libdnf/module/ModulePackage.hpp
index b618df58..145c6d63 100644
--- a/libdnf/module/ModulePackage.hpp
+++ b/libdnf/module/ModulePackage.hpp
@@ -71,7 +71,6 @@ public:
std::vector<ModuleDependencies> getModuleDependencies() const;
- ///DEPRECATED
void addStreamConflict(const ModulePackage * package);
Id getId() const { return id; };
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index 97c84c01..893b839a 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -204,7 +204,6 @@ private:
/// solvable.arch = <moduleArch>
/// solvable.summary = <moduleContext>
/// solvable.description = <moduleName>:<moduleStream>
- /// solvable.conflicts = module(<moduleName>)
DnfSack * moduleSack;
std::unique_ptr<PackageSet> activatedModules;
std::string installRoot;
diff --git a/libdnf/module/ModulePackageContainer.hpp b/libdnf/module/ModulePackageContainer.hpp
index 99fc0677..c1001fce 100644
--- a/libdnf/module/ModulePackageContainer.hpp
+++ b/libdnf/module/ModulePackageContainer.hpp
@@ -115,7 +115,6 @@ public:
Id addPlatformPackage(const std::string &osReleasePath, const char * platformModule);
Id addPlatformPackage(DnfSack * sack,
const std::vector<std::string> & osReleasePath, const char * platformModule);
- /// DEPRECATED
void createConflictsBetweenStreams();
/**
--
2.31.1

View File

@ -0,0 +1,214 @@
From 058b6112374f5feb5ee57488ac3fdbc7666a2016 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 10/19] Revert "Call addVersion2Modules(); as late as possible"
This reverts commit fe27dba67384e549a3be2a91c4a6cf1151113157.
---
libdnf/module/ModulePackageContainer.cpp | 28 +++---------------------
1 file changed, 3 insertions(+), 25 deletions(-)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index 893b839a..6ee2b68f 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -346,6 +346,7 @@ ModulePackageContainer::add(DnfSack * sack)
exception.what()));
}
}
+ pImpl->addVersion2Modules();
}
void ModulePackageContainer::addDefaultsFromDisk()
@@ -427,7 +428,6 @@ void ModulePackageContainer::createConflictsBetweenStreams()
bool ModulePackageContainer::empty() const noexcept
{
- pImpl->addVersion2Modules();
return pImpl->modules.empty();
}
@@ -521,13 +521,11 @@ bool ModulePackageContainer::isDisabled(const ModulePackage * module)
std::vector<std::string> ModulePackageContainer::getDefaultProfiles(std::string moduleName,
std::string moduleStream)
{
- pImpl->addVersion2Modules();
return pImpl->moduleMetadata.getDefaultProfiles(moduleName, moduleStream);
}
const std::string & ModulePackageContainer::getDefaultStream(const std::string &name) const
{
- pImpl->addVersion2Modules();
auto it = pImpl->moduleDefaults.find(name);
if (it == pImpl->moduleDefaults.end()) {
return EMPTY_RESULT;
@@ -537,7 +535,6 @@ const std::string & ModulePackageContainer::getDefaultStream(const std::string &
const std::string & ModulePackageContainer::getEnabledStream(const std::string &name)
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getStream(name);
}
@@ -547,7 +544,6 @@ const std::string & ModulePackageContainer::getEnabledStream(const std::string &
bool
ModulePackageContainer::enable(const std::string &name, const std::string & stream, const bool count)
{
- pImpl->addVersion2Modules();
if (count) {
pImpl->persistor->getEntry(name).second.streamChangesNum++;
}
@@ -573,7 +569,6 @@ ModulePackageContainer::enable(const ModulePackage * module, const bool count)
*/
void ModulePackageContainer::disable(const std::string & name, const bool count)
{
- pImpl->addVersion2Modules();
if (count) {
pImpl->persistor->getEntry(name).second.streamChangesNum++;
}
@@ -594,11 +589,11 @@ void ModulePackageContainer::disable(const ModulePackage * module, const bool co
*/
void ModulePackageContainer::reset(const std::string & name, const bool count)
{
- pImpl->addVersion2Modules();
if (count) {
pImpl->persistor->getEntry(name).second.streamChangesNum++;
}
pImpl->persistor->changeState(name, ModuleState::UNKNOWN);
+
pImpl->persistor->changeStream(name, "");
auto & profiles = pImpl->persistor->getEntry(name).second.profiles;
profiles.clear();
@@ -638,7 +633,6 @@ bool ModulePackageContainer::isChanged()
void ModulePackageContainer::install(const std::string &name, const std::string &stream,
const std::string &profile)
{
- pImpl->addVersion2Modules();
for (const auto &iter : pImpl->modules) {
auto modulePackage = iter.second.get();
if (modulePackage->getName() == name && modulePackage->getStream() == stream) {
@@ -656,7 +650,6 @@ void ModulePackageContainer::install(const ModulePackage * module, const std::st
void ModulePackageContainer::uninstall(const std::string &name, const std::string &stream,
const std::string &profile)
{
- pImpl->addVersion2Modules();
for (const auto &iter : pImpl->modules) {
auto modulePackage = iter.second.get();
if (modulePackage->getName() == name && modulePackage->getStream() == stream) {
@@ -744,7 +737,6 @@ ModulePackageContainer::query(Nsvcap& moduleNevra)
std::vector<ModulePackage *>
ModulePackageContainer::query(std::string subject)
{
- pImpl->addVersion2Modules();
// Alternatively a search using module provides could be performed
std::vector<ModulePackage *> result;
Query query(pImpl->moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
@@ -765,7 +757,6 @@ std::vector<ModulePackage *>
ModulePackageContainer::query(std::string name, std::string stream, std::string version,
std::string context, std::string arch)
{
- pImpl->addVersion2Modules();
// Alternatively a search using module provides could be performed
std::vector<ModulePackage *> result;
Query query(pImpl->moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
@@ -847,7 +838,6 @@ ModulePackageContainer::getModuleState(const std::string& name)
std::set<std::string> ModulePackageContainer::getInstalledPkgNames()
{
- pImpl->addVersion2Modules();
auto moduleNames = pImpl->persistor->getAllModuleNames();
std::set<std::string> pkgNames;
for (auto & moduleName: moduleNames) {
@@ -1029,7 +1019,6 @@ std::vector<std::vector<std::vector<ModulePackage *>>>
ModulePackageContainer::getLatestModulesPerRepo(ModuleState moduleFilter,
std::vector<ModulePackage *> modulePackages)
{
- pImpl->addVersion2Modules();
if (modulePackages.empty()) {
return {};
}
@@ -1113,7 +1102,6 @@ ModulePackageContainer::getLatestModulesPerRepo(ModuleState moduleFilter,
std::pair<std::vector<std::vector<std::string>>, ModulePackageContainer::ModuleErrorType>
ModulePackageContainer::resolveActiveModulePackages(bool debugSolver)
{
- pImpl->addVersion2Modules();
dnf_sack_reset_excludes(pImpl->moduleSack);
std::vector<ModulePackage *> packages;
@@ -1164,7 +1152,6 @@ bool ModulePackageContainer::isModuleActive(const ModulePackage * modulePackage)
std::vector<ModulePackage *> ModulePackageContainer::getModulePackages()
{
- pImpl->addVersion2Modules();
std::vector<ModulePackage *> values;
const auto & modules = pImpl->modules;
std::transform(
@@ -1186,56 +1173,47 @@ void ModulePackageContainer::rollback()
std::map<std::string, std::string> ModulePackageContainer::getEnabledStreams()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getEnabledStreams();
}
std::vector<std::string> ModulePackageContainer::getDisabledModules()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getDisabledModules();
}
std::map<std::string, std::string> ModulePackageContainer::getDisabledStreams()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getDisabledStreams();
}
std::vector<std::string> ModulePackageContainer::getResetModules()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getResetModules();
}
std::map<std::string, std::string> ModulePackageContainer::getResetStreams()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getResetStreams();
}
std::map<std::string, std::pair<std::string, std::string>>
ModulePackageContainer::getSwitchedStreams()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getSwitchedStreams();
}
std::map<std::string, std::vector<std::string>> ModulePackageContainer::getInstalledProfiles()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getInstalledProfiles();
}
std::vector<std::string> ModulePackageContainer::getInstalledProfiles(std::string moduleName)
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getProfiles(moduleName);
}
std::map<std::string, std::vector<std::string>> ModulePackageContainer::getRemovedProfiles()
{
- pImpl->addVersion2Modules();
return pImpl->persistor->getRemovedProfiles();
}
const std::string &
@@ -1641,7 +1619,7 @@ ModulePackageContainer::Impl::ModulePersistor::getRemovedProfiles()
void ModulePackageContainer::loadFailSafeData()
{
auto persistor = pImpl->persistor->configs;
-
+
std::map<std::string, std::pair<std::string, bool>> enabledStreams;
for (auto & nameConfig: persistor) {
if (nameConfig.second.second.state == ModuleState::ENABLED) {
--
2.31.1

View File

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

View File

@ -0,0 +1,171 @@
From 833966d8a8a6c87a3d51447f2adf2aa76190ecd8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 12/19] Revert "Add compatible layer for MdDocuments v2"
This reverts commit 32ccf6743cb9ce1579ff88804855a94f30876860.
---
libdnf/module/ModulePackageContainer.cpp | 68 +----------------------
libdnf/module/modulemd/ModuleMetadata.cpp | 11 +---
libdnf/module/modulemd/ModuleMetadata.hpp | 2 +-
3 files changed, 4 insertions(+), 77 deletions(-)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index 3f30037e..6e6134d2 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -69,23 +69,6 @@ void goal2name_query(libdnf::Goal & goal, libdnf::Query & query)
query.addFilter(HY_PKG_NAME, HY_EQ, module_names.data());
}
-/**
- * @brief In python => ";".join(list.sort())
- */
-std::string concentrateVectorString(std::vector<std::string> & list)
-{
- if (list.empty()) {
- return {};
- }
- std::sort(list.begin(), list.end());
- std::ostringstream ss;
- ss << *list.begin();
- for (auto require = std::next(list.begin()); require != list.end(); ++require) {
- ss << ";" << *require;
- }
- return ss.str();
-}
-
}
namespace std {
@@ -189,8 +172,6 @@ public:
const std::vector<ModulePackage *> & modules, bool debugSolver);
bool insert(const std::string &moduleName, const char *path);
std::vector<ModulePackage *> getLatestActiveEnabledModules();
- /// Required to call after all modules v3 are in metadata
- void addVersion2Modules();
private:
friend struct ModulePackageContainer;
@@ -204,8 +185,6 @@ private:
ModuleMetadata moduleMetadata;
std::map<std::string, std::string> moduleDefaults;
- std::vector<std::tuple<LibsolvRepo *, ModulemdModuleStream *, std::string>> modulesV2;
-
bool isEnabled(const std::string &name, const std::string &stream);
};
@@ -339,7 +318,6 @@ ModulePackageContainer::add(DnfSack * sack)
exception.what()));
}
}
- pImpl->addVersion2Modules();
}
void ModulePackageContainer::addDefaultsFromDisk()
@@ -375,7 +353,7 @@ ModulePackageContainer::add(const std::string &fileContent, const std::string &
if (strcmp(r->name, "available") == 0) {
g_autofree gchar * path = g_build_filename(pImpl->installRoot.c_str(),
"/etc/dnf/modules.d", NULL);
- auto packages = md.getAllModulePackages(pImpl->moduleSack, r, repoID, pImpl->modulesV2);
+ std::vector<ModulePackage *> packages = md.getAllModulePackages(pImpl->moduleSack, r, repoID);
for(auto const& modulePackagePtr: packages) {
std::unique_ptr<ModulePackage> modulePackage(modulePackagePtr);
pImpl->modules.insert(std::make_pair(modulePackage->getId(), std::move(modulePackage)));
@@ -1701,50 +1679,6 @@ std::vector<ModulePackage *> ModulePackageContainer::Impl::getLatestActiveEnable
return latest;
}
-void ModulePackageContainer::Impl::addVersion2Modules()
-{
- if (modulesV2.empty()) {
- return;
- }
- std::map<std::string, std::map<std::string, std::vector<ModulePackage *>>> v3_context_map;
- for (auto const & module_pair : modules) {
- auto * module = module_pair.second.get();
- auto requires = module->getRequires(true);
- auto concentratedRequires = concentrateVectorString(requires);
- v3_context_map[module->getNameStream()][concentratedRequires].push_back(module);
- }
- libdnf::LibsolvRepo * repo;
- ModulemdModuleStream * mdStream;
- std::string repoID;
- g_autofree gchar * path = g_build_filename(installRoot.c_str(), "/etc/dnf/modules.d", NULL);
- for (auto & module_tuple : modulesV2) {
- std::tie(repo, mdStream, repoID) = module_tuple;
- auto nameStream = ModulePackage::getNameStream(mdStream);
- auto requires = ModulePackage::getRequires(mdStream, true);
- auto concentratedRequires = concentrateVectorString(requires);
- auto streamIterator = v3_context_map.find(nameStream);
- if (streamIterator != v3_context_map.end()) {
- auto contextIterator = streamIterator->second.find(concentratedRequires);
- if (contextIterator != streamIterator->second.end()) {
- auto v3_context = contextIterator->second[0]->getContext();
- std::unique_ptr<ModulePackage> modulePackage(new ModulePackage(moduleSack, repo, mdStream, repoID, v3_context));
- persistor->insert(modulePackage->getName(), path);
- modules.insert(std::make_pair(modulePackage->getId(), std::move(modulePackage)));
- g_object_unref(mdStream);
- continue;
- }
- }
- if (concentratedRequires.empty()) {
- concentratedRequires.append("NoRequires");
- }
- std::unique_ptr<ModulePackage> modulePackage(new ModulePackage(moduleSack, repo, mdStream, repoID, concentratedRequires));
- persistor->insert(modulePackage->getName(), path);
- modules.insert(std::make_pair(modulePackage->getId(), std::move(modulePackage)));
- g_object_unref(mdStream);
- }
- modulesV2.clear();
-}
-
void ModulePackageContainer::updateFailSafeData()
{
auto fileNames = getYamlFilenames(pImpl->persistDir.c_str());
diff --git a/libdnf/module/modulemd/ModuleMetadata.cpp b/libdnf/module/modulemd/ModuleMetadata.cpp
index 07817ce1..fbdd8a13 100644
--- a/libdnf/module/modulemd/ModuleMetadata.cpp
+++ b/libdnf/module/modulemd/ModuleMetadata.cpp
@@ -126,8 +126,7 @@ void ModuleMetadata::resolveAddedMetadata()
std::vector<ModulePackage *> ModuleMetadata::getAllModulePackages(DnfSack * moduleSack,
LibsolvRepo * repo,
- const std::string & repoID,
- std::vector<std::tuple<LibsolvRepo *, ModulemdModuleStream *, std::string>> & modulesV2)
+ const std::string & repoID)
{
std::vector<ModulePackage *> result;
if (!resultingModuleIndex)
@@ -141,13 +140,7 @@ std::vector<ModulePackage *> ModuleMetadata::getAllModulePackages(DnfSack * modu
//TODO(amatej): replace with
//GPtrArray * streams = modulemd_module_index_search_streams_by_nsvca_glob(resultingModuleIndex, NULL);
for (unsigned int i = 0; i < streams->len; i++){
- ModulemdModuleStream * moduleMdStream = static_cast<ModulemdModuleStream *>(g_ptr_array_index(streams, i));
- if (modulemd_module_stream_get_mdversion(moduleMdStream) > 2) {
- result.push_back(new ModulePackage(moduleSack, repo, moduleMdStream, repoID));
- } else {
- g_object_ref(moduleMdStream);
- modulesV2.push_back(std::make_tuple(repo, moduleMdStream, repoID));
- }
+ result.push_back(new ModulePackage(moduleSack, repo, (ModulemdModuleStream *) g_ptr_array_index(streams, i), repoID));
}
}
diff --git a/libdnf/module/modulemd/ModuleMetadata.hpp b/libdnf/module/modulemd/ModuleMetadata.hpp
index 901d7402..df753b11 100644
--- a/libdnf/module/modulemd/ModuleMetadata.hpp
+++ b/libdnf/module/modulemd/ModuleMetadata.hpp
@@ -36,7 +36,7 @@ public:
~ModuleMetadata();
void addMetadataFromString(const std::string & yaml, int priority);
void resolveAddedMetadata();
- std::vector<ModulePackage *> getAllModulePackages(DnfSack * moduleSack, LibsolvRepo * repo, const std::string & repoID, std::vector<std::tuple<LibsolvRepo *, ModulemdModuleStream *, std::string>> & modulesV2);
+ std::vector<ModulePackage *> getAllModulePackages(DnfSack * moduleSack, LibsolvRepo * repo, const std::string & repoID);
std::map<std::string, std::string> getDefaultStreams();
std::vector<std::string> getDefaultProfiles(std::string moduleName, std::string moduleStream);
ModulemdObsoletes * getNewestActiveObsolete(ModulePackage *p);
--
2.31.1

View File

@ -0,0 +1,77 @@
From b1ed6e111ce05f8f1fe7b35afc1a3ef6f0731f7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 13/19] Revert "Add an alternative constructor for
ModulePackage"
This reverts commit d05bb263de6822c13ac4bd5cca3628318f5c7ce7.
---
libdnf/module/ModulePackage.cpp | 24 ++++++++++++------------
libdnf/module/ModulePackage.hpp | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/libdnf/module/ModulePackage.cpp b/libdnf/module/ModulePackage.cpp
index 63ee1656..8126bcaa 100644
--- a/libdnf/module/ModulePackage.cpp
+++ b/libdnf/module/ModulePackage.cpp
@@ -43,16 +43,16 @@ extern "C" {
namespace libdnf {
-/**
- * @brief create solvable with:
- * Name: $name:$stream:$context
- * Version: $version
- * Arch: $arch (If arch is not defined, set "noarch")
- * Provides: module($name)
- * Provides: module($name:$stream)
- */
-static void setSovable(Pool * pool, Solvable * solvable, const std::string & name,
- const std::string & stream, const std::string & version, const std::string & context, const char * arch)
+ /**
+ * @brief create solvable with:
+ * Name: $name:$stream:$context
+ * Version: $version
+ * Arch: $arch (If arch is not defined, set "noarch")
+ * Provides: module($name)
+ * Provides: module($name:$stream)
+ */
+ static void setSovable(Pool * pool, Solvable *solvable, std::string & name,
+ std::string & stream, std::string & version, std::string & context, const char * arch)
{
std::ostringstream ss;
// Name: $name:$stream:$context
@@ -86,7 +86,7 @@ static std::pair<std::string, std::string> parsePlatform(const std::string & pla
}
ModulePackage::ModulePackage(DnfSack * moduleSack, LibsolvRepo * repo,
- ModulemdModuleStream * mdStream, const std::string & repoID, const std::string & context)
+ ModulemdModuleStream * mdStream, const std::string & repoID)
: mdStream(mdStream)
, moduleSack(moduleSack)
, repoID(repoID)
@@ -98,7 +98,7 @@ ModulePackage::ModulePackage(DnfSack * moduleSack, LibsolvRepo * repo,
id = repo_add_solvable(repo);
Solvable *solvable = pool_id2solvable(pool, id);
- setSovable(pool, solvable, getName(), getStream(), getVersion(), context.empty() ? getContext() : context, getArchCStr());
+ setSovable(pool, solvable, getName(), getStream(), getVersion(), getContext(), getArchCStr());
createDependencies(solvable);
HyRepo hyRepo = static_cast<HyRepo>(repo->appdata);
libdnf::repoGetImpl(hyRepo)->needs_internalizing = 1;
diff --git a/libdnf/module/ModulePackage.hpp b/libdnf/module/ModulePackage.hpp
index 145c6d63..47cc995c 100644
--- a/libdnf/module/ModulePackage.hpp
+++ b/libdnf/module/ModulePackage.hpp
@@ -95,7 +95,7 @@ private:
friend struct ModuleMetadata;
ModulePackage(DnfSack * moduleSack, LibsolvRepo * repo,
- ModulemdModuleStream * mdStream, const std::string & repoID, const std::string & context = {});
+ ModulemdModuleStream * mdStream, const std::string & repoID);
ModulePackage(const ModulePackage & mpkg);
ModulePackage & operator=(const ModulePackage & mpkg);
--
2.31.1

View File

@ -0,0 +1,113 @@
From 6c9540be5ac3e3bc3f9a60133b402945705b934f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Sun, 25 Apr 2021 19:47:53 +0200
Subject: [PATCH 14/19] Revert "Adjust modular solver to new context type"
This reverts commit 921d4db62cda41f7999aff67882ad0c01c766916.
---
libdnf/module/ModulePackageContainer.cpp | 46 +++++-------------------
1 file changed, 8 insertions(+), 38 deletions(-)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index 6e6134d2..c0ad1260 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -49,28 +49,6 @@ extern "C" {
#include "modulemd/ModuleMetadata.hpp"
#include "modulemd/ModuleProfile.hpp"
-
-namespace {
-
-/// Requires resolved goal
-/// Takes listInstalls() from goal and keep solvables with the solvable-name (<name>:<stream>:<context>) in query
-void goal2name_query(libdnf::Goal & goal, libdnf::Query & query)
-{
- auto pool = dnf_sack_get_pool(goal.getSack());
- auto installList = goal.listInstalls();
- std::vector<const char *> module_names;
- Id id = -1;
- while ((id = installList.next(id)) != -1) {
- Solvable * s = pool_id2solvable(pool, id);
- const char * name = pool_id2str(pool, s->name);
- module_names.push_back(name);
- }
- module_names.push_back(nullptr);
- query.addFilter(HY_PKG_NAME, HY_EQ, module_names.data());
-}
-
-}
-
namespace std {
template<>
@@ -651,14 +629,14 @@ ModulePackageContainer::Impl::moduleSolve(const std::vector<ModulePackage *> & m
for (const auto &module : modules) {
std::ostringstream ss;
auto name = module->getName();
- ss << "module(" << name << ":" << module->getStream() << ")";
+ ss << "module(" << name << ":" << module->getStream() << ":" << module->getVersion() << ")";
Selector selector(moduleSack);
bool optional = persistor->getState(name) == ModuleState::DEFAULT;
selector.set(HY_PKG_PROVIDES, HY_EQ, ss.str().c_str());
goal.install(&selector, optional);
goalWeak.install(&selector, true);
}
- auto ret = goal.run(static_cast<DnfGoalActions>(DNF_IGNORE_WEAK | DNF_FORCE_BEST));
+ auto ret = goal.run(DNF_IGNORE_WEAK);
if (debugSolver) {
goal.writeDebugdata("debugdata/modules");
}
@@ -666,7 +644,7 @@ ModulePackageContainer::Impl::moduleSolve(const std::vector<ModulePackage *> & m
auto problemType = ModulePackageContainer::ModuleErrorType::NO_ERROR;
if (ret) {
problems = goal.describeAllProblemRules(false);
- ret = goal.run(DNF_FORCE_BEST);
+ ret = goal.run(DNF_NONE);
if (ret) {
// Conflicting modules has to be removed otherwice it could result than one of them will
// be active
@@ -680,20 +658,14 @@ ModulePackageContainer::Impl::moduleSolve(const std::vector<ModulePackage *> & m
activatedModules.reset();
} else {
problemType = ModulePackageContainer::ModuleErrorType::ERROR;
- Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
- goal2name_query(goalWeak, query);
- activatedModules.reset(new PackageSet(*query.runSet()));
+ activatedModules.reset(new PackageSet(std::move(goalWeak.listInstalls())));
}
} else {
problemType = ModulePackageContainer::ModuleErrorType::ERROR_IN_DEFAULTS;
- Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
- goal2name_query(goal, query);
- activatedModules.reset(new PackageSet(*query.runSet()));
+ activatedModules.reset(new PackageSet(std::move(goal.listInstalls())));
}
} else {
- Query query(moduleSack, Query::ExcludeFlags::IGNORE_EXCLUDES);
- goal2name_query(goal, query);
- activatedModules.reset(new PackageSet(*query.runSet()));
+ activatedModules.reset(new PackageSet(std::move(goal.listInstalls())));
}
return make_pair(problems, problemType);
}
@@ -735,14 +707,12 @@ ModulePackageContainer::query(std::string name, std::string stream, std::string
query.available();
std::ostringstream ss;
ss << stringFormater(name) << ":" << stringFormater(stream);
- ss << ":" << stringFormater(context);
+ ss << ":" << stringFormater(version) << ":";
+ ss << stringFormater(context);
query.addFilter(HY_PKG_NAME, HY_GLOB, ss.str().c_str());
if (!arch.empty()) {
query.addFilter(HY_PKG_ARCH, HY_GLOB, arch.c_str());
}
- if (!version.empty()) {
- query.addFilter(HY_PKG_VERSION, HY_GLOB, version.c_str());
- }
auto pset = query.runSet();
Id moduleId = -1;
while ((moduleId = pset->next(moduleId)) != -1) {
--
2.31.1

View File

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

View File

@ -0,0 +1,34 @@
From faaa64a51445b6edffe6f1e65c465dea63f11bf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Tue, 27 Apr 2021 10:24:53 +0200
Subject: [PATCH 16/19] Fix failing unittest, caused by the revert of new
modular implementation
The problem is not caused by advisory filtering which we are testing
here, the `query` is already created with just one package.
---
tests/libdnf/sack/QueryTest.cpp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/tests/libdnf/sack/QueryTest.cpp b/tests/libdnf/sack/QueryTest.cpp
index ee9eeaf4..7c3a22af 100644
--- a/tests/libdnf/sack/QueryTest.cpp
+++ b/tests/libdnf/sack/QueryTest.cpp
@@ -139,13 +139,10 @@ void QueryTest::testQueryFilterAdvisory()
dnf_sack_filter_modules_v2(sack, modules, nullptr, tmpdir, nullptr, true, false, false);
query = new libdnf::Query(sack);
query->addFilter(HY_PKG_ADVISORY_TYPE, HY_EQ, "enhancement");
- CPPUNIT_ASSERT(query->size() == 2);
+ CPPUNIT_ASSERT(query->size() == 1);
libdnf::PackageSet pset2 = *(query->getResultPset());
pkg = dnf_package_new(sack, pset2[0]);
CPPUNIT_ASSERT(!g_strcmp0(dnf_package_get_name(pkg), "test-perl-DBI"));
g_object_unref(pkg);
- pkg = dnf_package_new(sack, pset2[1]);
- CPPUNIT_ASSERT(!g_strcmp0(dnf_package_get_name(pkg), "test-perl-DBI"));
- g_object_unref(pkg);
delete query;
}
--
2.31.1

View File

@ -0,0 +1,274 @@
From a61b0105aafeea8487902463f789e6ed00021eb3 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Wed, 5 May 2021 15:55:43 +0200
Subject: [PATCH 17/19] Modify unit test after change of handling advisories
The patch modifies also yaml with multicollection situation by adding
module requires.
---
data/tests/advisories/modules.yaml | 6 +++++
.../tests/advisories/repodata/modules.yaml.gz | Bin 300 -> 332 bytes
data/tests/advisories/repodata/primary.xml.gz | Bin 743 -> 743 bytes
data/tests/advisories/repodata/repomd.xml | 24 +++++++++---------
tests/libdnf/sack/AdvisoryTest.cpp | 22 ++++++----------
tests/libdnf/sack/QueryTest.cpp | 24 ++++++++----------
6 files changed, 37 insertions(+), 39 deletions(-)
diff --git a/data/tests/advisories/modules.yaml b/data/tests/advisories/modules.yaml
index 6db5053a..b5f23f7d 100644
--- a/data/tests/advisories/modules.yaml
+++ b/data/tests/advisories/modules.yaml
@@ -32,6 +32,9 @@ data:
license:
module:
- MIT
+ dependencies:
+ - requires:
+ perl: ["5.23"]
profiles:
default:
rpms: ["test-perl-DBI"]
@@ -52,6 +55,9 @@ data:
license:
module:
- MIT
+ dependencies:
+ - requires:
+ perl: ["5.25"]
profiles:
default:
rpms: ["test-perl-DBI"]
diff --git a/data/tests/advisories/repodata/modules.yaml.gz b/data/tests/advisories/repodata/modules.yaml.gz
index 7158e6c515720c87373762d722e9c438ac7fd8d3..ed39532dfcdec084a661d51d86e07bd3e4246f69 100644
GIT binary patch
literal 332
zcmV-S0ki%eiwFP!000001I>{=Ps1<}hWGr6Q`gE7ag#Rnz<^jfATh8ZR2}w3Sc;us
zJE;77+&V2`Kt&yZ?cV$H`F$8;nd;<V$OZwXQ$tHeWpCuX?yLZwDGVqw0E>nM^yJzo
zd~k$Dz^uyoVipspfg%do*+9Fv4>2lq@<qU|UT&A=esnMf-MfJMv`UeePWRz3ea&J9
zj-^&hvYx~tmu^cjgS*W`jC$8Kx+R~oiW(f+kOYA1jX%Z=0{Otk>(K?>pbTUAvvJbK
zu0;G>$%;HZyrs6DS4GX|H7^S!#q;q?d7fwN0vp-w&1Pz)K_AF{F_TZt<j-f!92b6P
z=vY2$s-m8(A}e(=mVu+!K|4CRxxZe(<DUJ~g%rkPencX+Mj8d<QxwapUd`9_YK@Jn
eejSDUe<-TIL$NBWgd)&lisAzcI?AeD1ONa}51~l_
literal 300
zcmV+{0n`2;iwFP!000001Kp56Ps1<}#rJ%QQ`g85ar4LZz<^jfATh94hka2a*-2zO
zsC;`&okAE82nhzZd++X^&p*akrbjhf8iE8n>e-Oh*%LY6kAnoBX$&YcfB`K@n8=wZ
zd~k$T!lo|xb`y=ag)#~?4uMWF4>2lq>L}qPnnP2)uFlq?dzNsYqBMEs`YD{ZuUT~9
z(lWiG!IM0D>9$lexZ6L(YI0-O8}iB3)ZuJG5&&+p{!%jt<O5r-M;H1IRan~ZgR3!i
zCF9>JRu<{u0~wLmrQo^XRf(i|v3#j0ij4gLBfGuXuTfg`f!qg}d<~O7egSg{{0!*Q
y{uQW8_P4;s(FnI>d`-5gMVs$LyTi`ae@<5YXR>WoC$fRIYqBpd!@UUm0{{Tgm5(X_
diff --git a/data/tests/advisories/repodata/primary.xml.gz b/data/tests/advisories/repodata/primary.xml.gz
index da9ffaf08328659c47be8721a9c478ff64ba0a4d..96cbaa2a5a2361b1e5cd59ddb7de937339982c5f 100644
GIT binary patch
literal 743
zcmV<D0vP=tiwFP!000001Lao9Zrd;rz2_?ko>~O9B%0I`ND2@%1#&3RBI%*0fTBhg
zVQr-(BktFi)Dqj>k`zsgpnzeM!#6X0Z#V;o=XYg+wxC*BR}prWHbzj1I+fKr!XIzm
zE_{3*pM)iJJmnon8eX*#&bzKTv#df^{oOL{H?V}Xw`P<j>awgWJfhE3Q$FaSF&H&m
zZ1@^<e1dh-X^XmD0}(ce_ynP_;w8i#wB4csRV?0IT!q$PGlyJ>JihbYTbG8`urbz&
zAcCeAd4x4dZP9cwQc&n@%d$@U0&b!3PhIAFr-APUJW~u?gTKf@Y}&q@uF~e5FjwDq
zvzBRuKV4qqc$Eb!8hEKs2%}j*IQ0ebAY}{^!F=%3#H9{l`Y>@gB?&m5V>{r|AoIZ2
zx1Ey=8TD_;)o$Ra)1ddG7NIpC7*GnWP_pSXwfN*Fmo3sCj%Hbqah^pDts}Jdo(@zT
zTK7w1?^U5q=G*K#Spv#rp=moVv3)HJ)zp(-7Mi-ld=@yAIAl_)m0w^^8DZD<DMqqt
zJ6;r!4$7ON$gK%S=;Tz?f}3lhTtOD$quMT<#m~#L94oyvZ(|IV)vDy3S?Y~8pA}L-
z)k6I4>L#=f4SUEIs<bvT9BlTdYgPA6e7$QsDA8rLm8z~vs5<L{w=nvQkiE+wPF}ZN
zY?u{hH3IhsdvII#N`PL)PvG4uVMvcr_Yw9{bKohch2oWNAT7V@B21Z0O?#)NFw`Cu
zoA8aQw^F~5(KHz~OSMC$x4tO~Mp?nvx=$}Z;NNYkhqJuW)m^ys^`FT$YIV$W$gkjY
zFV$nH|LP)aIX~w))nVMwnjhwUv;DgP=TSDQ)4}TT1CDdwag)qW1VF|-lF*b;;bZ|1
zAaQI#T&4p%e8n;rxT^$g0fA4l#Lc{bQ1?X-INM$QwE=fnp8sjU9r1o~1Md5#dd>m&
ZqioMV;M}JUxcmQi@mJ$x7+z@#006pgY0dxu
literal 743
zcmV<D0vP=tiwFP!000001LamrZ`&{ozV}xMI&CNtTZ-gIVY@)F4(MUPhIWUY3R$LO
zBYsV`gJ!>ek{?a7SKDFTPz(qXk^D&NBSj*?`CVC{EvPoHs}Pf=jS*C`PV#CU;*U3P
z7al&3PJ$9Tk%&$p4X@e|XI<BvSyqu({oOL@H?V}Hw`P<j>$0pXJfhE3Q$FaSF&H&M
zZp0dNe2R6_NkrYQfe;%+bb?S&i4vj?+HTQ+Di&`pt^#Y&8KY1#i|#z<)?tA)2u3>*
zM9|bS3$Z4tHJUC)3JRTVS=LEkz%3Nsslz?@)c0Ipq>5u}@Ru3LP1~2#RoYBY?&$k&
z)_D@*PnXv?TBZJq`EKG-%311D!8}P_NH~XBau2*Db{L^t8)G6Eje)qtCg3nXb-~lO
zos$e1^=~QEZs4iYp!Z`f0&6xHPy($~dDCfX(aBAgw@7~kn#+QW^IX)xIznsj$)KXZ
zx<49yuL`X)-$v^45>T2Knl^C=^<0m+ntI&lg{Drp$9=*mp;M*W{0qz}L+scd!zi!X
zP80<sL*-3V@~sI++2mBzQkZL@OhFprquwsa;^*yIj-6hbw=srFYgLNQ9JQd;XGJcd
zY9V@ebrV>JialftRZ^QW90+^sTGf3MUGLfsN_1Imb5&O*RGoDpS{Qvs$lhfrPFA;F
zWSAA^Gy?aAJ-DrVB|)E}C-82SG^EF<`w07}8HfbbLWxQbkS@RKLd>|$%y=iJG0Yw-
zHsKppZ*%=ZM%AR$EY%K~+4`m_7^Q_+>p8vrfPZ(W9?tSgcX#2i*MBD4SgT{6Lw*IH
z`&>PS`mZj+m-BO;Qys<)todQy58J<6a4zFxbvjr*e!&Uh5hqUVSOTQnr7=q=lO*+p
z4>7SNb+`^p#EPffcUCdj5`2%Qv6H$!WzLIUaJIAhYYXnMJ^#~!JL3J~7Totk^_&at
ZN7<f#!8uP|aQFZ3qOUfbJ%VWp006EqV{!lh
diff --git a/data/tests/advisories/repodata/repomd.xml b/data/tests/advisories/repodata/repomd.xml
index 21630e04..c9468e82 100644
--- a/data/tests/advisories/repodata/repomd.xml
+++ b/data/tests/advisories/repodata/repomd.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
- <revision>1612879414</revision>
+ <revision>1620890113</revision>
<data type="primary">
- <checksum type="sha256">b69e4467719314fdb155872cf9c8e895d5b169c0506c5180c512d693c48f0f4b</checksum>
- <open-checksum type="sha256">8606d1f777859f167f7bd0bf8a1d532abedcb4db143b719e631e1040800fd1f0</open-checksum>
+ <checksum type="sha256">f2f306a22a157730d2f13f09fc36c425b9bedfc0ecaf74d8b60d98222ebb3274</checksum>
+ <open-checksum type="sha256">ef20a9175429f9f223c4bdcd634fc218bdd85799095438d349efea159cfd2bdf</open-checksum>
<location href="repodata/primary.xml.gz"/>
- <timestamp>1612879414</timestamp>
+ <timestamp>1620890113</timestamp>
<size>743</size>
<open-size>2665</open-size>
</data>
@@ -13,7 +13,7 @@
<checksum type="sha256">efbf7f021163a3c7698a257351e327102c60bb39a7bdceee77c421f064205e99</checksum>
<open-checksum type="sha256">ca5620e2734574d04d3c01ae5a72f865313369954698d71776076b9cbd831bbd</open-checksum>
<location href="repodata/filelists.xml.gz"/>
- <timestamp>1612879414</timestamp>
+ <timestamp>1620890113</timestamp>
<size>311</size>
<open-size>511</open-size>
</data>
@@ -21,23 +21,23 @@
<checksum type="sha256">6673953e1f28f55b9d4c3f38a9e3c0e0ff88ad06fb693b7f15eb241a81b80d71</checksum>
<open-checksum type="sha256">0997c242bf1b96372d7a625a73de23dced68cae9375baff0c73215a07693b3f4</open-checksum>
<location href="repodata/other.xml.gz"/>
- <timestamp>1612879414</timestamp>
+ <timestamp>1620890113</timestamp>
<size>310</size>
<open-size>507</open-size>
</data>
<data type="modules">
- <checksum type="sha256">a815d0669b15b97dd6260713405c79045eeda10aedb6460a0f742b86cc236cca</checksum>
- <open-checksum type="sha256">0d1063b74e3a7cb4c7cdc3b2080b1901c347693140765534f8c5c3d8b964778a</open-checksum>
+ <checksum type="sha256">df1abc1ab7dacc6ea2bc16c2b14abeb32d0ec9d9ed01378488cec22540f9607b</checksum>
+ <open-checksum type="sha256">f088c4096bfc4acad99a20e06d0d4381872c10f0f27ff8bbfe1bada658ff7afd</open-checksum>
<location href="repodata/modules.yaml.gz"/>
- <timestamp>1612879414</timestamp>
- <size>300</size>
- <open-size>1019</open-size>
+ <timestamp>1620890113</timestamp>
+ <size>332</size>
+ <open-size>1117</open-size>
</data>
<data type="updateinfo">
<checksum type="sha256">9d791d16c2adc2d7d4c85b45f2a704edac62a926b09fc20df73207f4190acd49</checksum>
<open-checksum type="sha256">3cf7df860860ac7a4a8e64a1a2d71c1ec43225dacbfe09a0cff80f28be3825da</open-checksum>
<location href="repodata/updateinfo.xml.gz"/>
- <timestamp>1612879414</timestamp>
+ <timestamp>1620890113</timestamp>
<size>708</size>
<open-size>2414</open-size>
</data>
diff --git a/tests/libdnf/sack/AdvisoryTest.cpp b/tests/libdnf/sack/AdvisoryTest.cpp
index 805c35da..1abf1a95 100644
--- a/tests/libdnf/sack/AdvisoryTest.cpp
+++ b/tests/libdnf/sack/AdvisoryTest.cpp
@@ -97,11 +97,9 @@ void AdvisoryTest::testGetApplicablePackagesModulesNotSetup()
// When modules are not setup all advisory collections are applicable and we get all packages
advisory->getApplicablePackages(pkgsvector);
- CPPUNIT_ASSERT(pkgsvector.size() == 4);
+ CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(pkgsvector.size()));
CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[0].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[1].getNameString(), "test-perl-DBI-new-collection-override"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[2].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[3].getNameString(), "not-present"));
+ CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[1].getNameString(), "not-present"));
}
void AdvisoryTest::testGetApplicablePackagesModulesSetupNoneEnabled()
@@ -122,16 +120,14 @@ void AdvisoryTest::testGetApplicablePackagesOneApplicableCollection()
{
std::vector<libdnf::AdvisoryPkg> pkgsvector;
- // When I keep enabled only perl-DBI module I get packages from all collections that contain that module
+ // When I keep enabled only perl module I get packages from all collections that contain that module
libdnf::ModulePackageContainer * modules = dnf_sack_get_module_container(sack);
- modules->reset("perl");
+ modules->reset("perl-DBI");
dnf_sack_filter_modules_v2(sack, modules, nullptr, tmpdir, nullptr, true, false, false);
advisory->getApplicablePackages(pkgsvector);
- CPPUNIT_ASSERT(pkgsvector.size() == 3);
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[0].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[1].getNameString(), "test-perl-DBI-new-collection-override"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[2].getNameString(), "test-perl-DBI"));
+ CPPUNIT_ASSERT(pkgsvector.size() == 1);
+ CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[0].getNameString(), "not-present"));
}
void AdvisoryTest::testGetApplicablePackagesMultipleApplicableCollections()
@@ -141,11 +137,9 @@ void AdvisoryTest::testGetApplicablePackagesMultipleApplicableCollections()
// When I enable modules from multiple collections -> I get packages from all applicable collections
// Enabled - "perl-DBI:master", "perl:5.23"
advisory->getApplicablePackages(pkgsvector);
- CPPUNIT_ASSERT(pkgsvector.size() == 4);
+ CPPUNIT_ASSERT(pkgsvector.size() == 2);
CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[0].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[1].getNameString(), "test-perl-DBI-new-collection-override"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[2].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[3].getNameString(), "not-present"));
+ CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[1].getNameString(), "not-present"));
}
void AdvisoryTest::testGetModules()
diff --git a/tests/libdnf/sack/QueryTest.cpp b/tests/libdnf/sack/QueryTest.cpp
index 7c3a22af..d4cc28c2 100644
--- a/tests/libdnf/sack/QueryTest.cpp
+++ b/tests/libdnf/sack/QueryTest.cpp
@@ -59,12 +59,13 @@ void QueryTest::testQueryGetAdvisoryPkgs()
HyQuery query = new libdnf::Query(sack);
std::vector<libdnf::AdvisoryPkg> advisoryPkgs;
- // When modules are not setup all advisory collections are applicable
+ // Apply advisory only from active context - receave advisory package only from releted collection
query->getAdvisoryPkgs(HY_EQ, advisoryPkgs);
- CPPUNIT_ASSERT(advisoryPkgs.size() == 2);
- // We get test-perl-DBI twice because its in two collections
- CPPUNIT_ASSERT(!g_strcmp0(advisoryPkgs[0].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(advisoryPkgs[1].getNameString(), "test-perl-DBI"));
+ CPPUNIT_ASSERT(advisoryPkgs.size() == 1);
+
+ CPPUNIT_ASSERT_EQUAL(std::string("test-perl-DBI"), std::string(advisoryPkgs[0].getNameString()));
+ CPPUNIT_ASSERT_EQUAL(std::string("1-2.module_el8+6587+9879afr5"), std::string(advisoryPkgs[0].getEVRString()));
+ //CPPUNIT_ASSERT(!g_strcmp0(advisoryPkgs[1].getNameString(), "test-perl-DBI"));
// When modules are setup but none are enabled all collections are not applicable - no enabled module
libdnf::ModulePackageContainer * modules = dnf_sack_get_module_container(sack);
@@ -84,15 +85,15 @@ void QueryTest::testQueryGetAdvisoryPkgs()
query->getAdvisoryPkgs(HY_EQ, advisoryPkgs);
CPPUNIT_ASSERT(advisoryPkgs.size() == 0);
- // When I enable a module from multiple collections that contain a present package I get them
+ // When I enable a module with multiple collections I will receave advisory packages only for active context
CPPUNIT_ASSERT(modules->enable("perl-DBI", "master", false));
dnf_sack_filter_modules_v2(sack, modules, nullptr, tmpdir, nullptr, true, false, false);
advisoryPkgs.clear();
query->getAdvisoryPkgs(HY_EQ, advisoryPkgs);
- CPPUNIT_ASSERT(advisoryPkgs.size() == 2);
- CPPUNIT_ASSERT(!g_strcmp0(advisoryPkgs[0].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(advisoryPkgs[1].getNameString(), "test-perl-DBI"));
+ CPPUNIT_ASSERT(advisoryPkgs.size() == 1);
+ CPPUNIT_ASSERT_EQUAL(std::string("test-perl-DBI"), std::string(advisoryPkgs[0].getNameString()));
+ CPPUNIT_ASSERT_EQUAL(std::string("1-2.module_el8+6587+9879afr5"), std::string(advisoryPkgs[0].getEVRString()));
delete query;
}
@@ -102,16 +103,13 @@ void QueryTest::testQueryFilterAdvisory()
// When modules are not setup all advisory collections are applicable and there is no modular filtering
HyQuery query = new libdnf::Query(sack);
query->addFilter(HY_PKG_ADVISORY_TYPE, HY_EQ, "enhancement");
- CPPUNIT_ASSERT(query->size() == 2);
+ CPPUNIT_ASSERT(query->size() == 1);
// We get test-perl-DBI twice because its in two collections
libdnf::PackageSet pset = *(query->getResultPset());
DnfPackage *pkg = dnf_package_new(sack, pset[0]);
CPPUNIT_ASSERT(!g_strcmp0(dnf_package_get_name(pkg), "test-perl-DBI"));
g_object_unref(pkg);
- pkg = dnf_package_new(sack, pset[1]);
- CPPUNIT_ASSERT(!g_strcmp0(dnf_package_get_name(pkg), "test-perl-DBI"));
- g_object_unref(pkg);
delete query;
// When module are setup but none are enabled all collections are not applicable - no enabled module
--
2.31.1

View File

@ -0,0 +1,34 @@
From c7f0b13bf32cfba63a2db6257c50ae1ba5c8f9ba Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Thu, 6 May 2021 11:18:20 +0200
Subject: [PATCH 18/19] Adjust module error formatting function for original
modular solver
The new solver uses libsolv solvable by another way. The revert requires
also change in formatting function.
---
libdnf/goal/Goal.cpp | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp
index a6f11a4f..6b2f91a2 100644
--- a/libdnf/goal/Goal.cpp
+++ b/libdnf/goal/Goal.cpp
@@ -58,12 +58,8 @@ std::string moduleSolvid2str(Pool * pool, Id source)
{
std::ostringstream ss;
auto * solvable = pool_id2solvable(pool, source);
- // Add name:stream
- ss << solvable_lookup_str(solvable, SOLVABLE_DESCRIPTION);
- //Add version
- ss << ":" << pool_id2str(pool, solvable->evr);
- // Add original context
- ss << ":" << solvable_lookup_str(solvable, SOLVABLE_SUMMARY);
+ // Add name:stream:version:context
+ ss << pool_id2str(pool, solvable->name);
ss << "." << pool_id2str(pool, solvable->arch);
return ss.str();
}
--
2.31.1

View File

@ -0,0 +1,57 @@
From eb7217d0a71b92ac0d8c3773caa1a2d3a2c20071 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Thu, 13 May 2021 09:10:42 +0200
Subject: [PATCH 19/19] Remove redundant test
The test is identical to
testGetApplicablePackagesMultipleApplicableCollections().
---
tests/libdnf/sack/AdvisoryTest.cpp | 11 -----------
tests/libdnf/sack/AdvisoryTest.hpp | 2 --
2 files changed, 13 deletions(-)
diff --git a/tests/libdnf/sack/AdvisoryTest.cpp b/tests/libdnf/sack/AdvisoryTest.cpp
index 1abf1a95..f5892634 100644
--- a/tests/libdnf/sack/AdvisoryTest.cpp
+++ b/tests/libdnf/sack/AdvisoryTest.cpp
@@ -91,17 +91,6 @@ void AdvisoryTest::testGetPackages()
CPPUNIT_ASSERT(pkgsvector.size() == 4);
}
-void AdvisoryTest::testGetApplicablePackagesModulesNotSetup()
-{
- std::vector<libdnf::AdvisoryPkg> pkgsvector;
-
- // When modules are not setup all advisory collections are applicable and we get all packages
- advisory->getApplicablePackages(pkgsvector);
- CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(pkgsvector.size()));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[0].getNameString(), "test-perl-DBI"));
- CPPUNIT_ASSERT(!g_strcmp0(pkgsvector[1].getNameString(), "not-present"));
-}
-
void AdvisoryTest::testGetApplicablePackagesModulesSetupNoneEnabled()
{
std::vector<libdnf::AdvisoryPkg> pkgsvector;
diff --git a/tests/libdnf/sack/AdvisoryTest.hpp b/tests/libdnf/sack/AdvisoryTest.hpp
index 6eb25a57..cb0d8c05 100644
--- a/tests/libdnf/sack/AdvisoryTest.hpp
+++ b/tests/libdnf/sack/AdvisoryTest.hpp
@@ -19,7 +19,6 @@ class AdvisoryTest : public CppUnit::TestCase
CPPUNIT_TEST(testGetSeverity);
CPPUNIT_TEST(testGetTitle);
CPPUNIT_TEST(testGetPackages);
- CPPUNIT_TEST(testGetApplicablePackagesModulesNotSetup);
CPPUNIT_TEST(testGetApplicablePackagesModulesSetupNoneEnabled);
CPPUNIT_TEST(testGetApplicablePackagesOneApplicableCollection);
CPPUNIT_TEST(testGetApplicablePackagesMultipleApplicableCollections);
@@ -38,7 +37,6 @@ public:
void testGetSeverity();
void testGetTitle();
void testGetPackages();
- void testGetApplicablePackagesModulesNotSetup();
void testGetApplicablePackagesModulesSetupNoneEnabled();
void testGetApplicablePackagesOneApplicableCollection();
void testGetApplicablePackagesMultipleApplicableCollections();
--
2.31.1

View File

@ -0,0 +1,28 @@
From 4a8a3f410552c58dfafb384bb361c6e40bebff1d Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Wed, 21 Jul 2021 11:01:32 +0200
Subject: [PATCH] Fix: dnf_context_module_install: memory leaks
---
libdnf/dnf-context.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp
index 55af2b2..6cb0011 100644
--- a/libdnf/dnf-context.cpp
+++ b/libdnf/dnf-context.cpp
@@ -3486,7 +3486,10 @@ dnf_context_module_install(DnfContext * context, const char ** module_specs, GEr
}
for (const auto &nevra : modpkg->getArtifacts()) {
int epoch;
- char *name, *version, *release, *arch;
+ g_autofree char *name = nullptr;
+ g_autofree char *version = nullptr;
+ g_autofree char *release = nullptr;
+ g_autofree char *arch = nullptr;
if (hy_split_nevra(nevra.c_str(), &name, &epoch, &version, &release, &arch)) {
// this really should never happen; unless the modular repodata is corrupted
g_autofree char *errmsg = g_strdup_printf (_("Failed to parse module artifact NEVRA '%s'"), nevra.c_str());
--
libgit2 1.0.1

View File

@ -0,0 +1,91 @@
From 07416268889f95e1495fb3d7b856de1c502870ba Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Wed, 21 Jul 2021 11:15:50 +0200
Subject: [PATCH] covscan: remove unused vars, mark private func static, return values
The `begin` and `end` variables were not used
in `ModulePackageContainer::updateFailSafeData`. Removed.
The `checksum` in "utils.cpp" is a private (static) function.
Added check of return value of `dnf_copy_recursive` function in unit test.
In the `install` in the "goal-py.cpp" file:
Explicitly ignores the return values of `hy_goal_install` and
`hy_goal_install_optional`. The functions always return zero.
Explicitly ignores the return values of `hy_goal_install_selector` and
`hy_goal_install_selector_optional`. The `error` argument is used instead.
---
libdnf/module/ModulePackageContainer.cpp | 2 --
libdnf/utils/utils.cpp | 2 +-
python/hawkey/goal-py.cpp | 8 ++++----
tests/libdnf/module/ModulePackageContainerTest.cpp | 3 ++-
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index c0ad126..efab497 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -1656,8 +1656,6 @@ void ModulePackageContainer::updateFailSafeData()
if (pImpl->activatedModules) {
std::vector<ModulePackage *> latest = pImpl->getLatestActiveEnabledModules();
- auto begin = fileNames.begin();
- auto end = fileNames.end();
if (g_mkdir_with_parents(pImpl->persistDir.c_str(), 0755) == -1) {
const char * errTxt = strerror(errno);
auto logger(Log::getLogger());
diff --git a/libdnf/utils/utils.cpp b/libdnf/utils/utils.cpp
index 450718d..15f5275 100644
--- a/libdnf/utils/utils.cpp
+++ b/libdnf/utils/utils.cpp
@@ -301,7 +301,7 @@ void decompress(const char * inPath, const char * outPath, mode_t outMode, const
fclose(inFile);
}
-void checksum(const char * type, const char * inPath, const char * checksum_valid, bool * valid_out, gchar ** calculated_out)
+static void checksum(const char * type, const char * inPath, const char * checksum_valid, bool * valid_out, gchar ** calculated_out)
{
GError * errP{nullptr};
gboolean valid;
diff --git a/python/hawkey/goal-py.cpp b/python/hawkey/goal-py.cpp
index 2641a1d..5bbb959 100644
--- a/python/hawkey/goal-py.cpp
+++ b/python/hawkey/goal-py.cpp
@@ -281,15 +281,15 @@ install(_GoalObject *self, PyObject *args, PyObject *kwds) try
if (flags & HY_WEAK_SOLV) {
if (pkg) {
- hy_goal_install_optional(self->goal, pkg);
+ (void)hy_goal_install_optional(self->goal, pkg);
} else {
- hy_goal_install_selector_optional(self->goal, sltr, &error);
+ (void)hy_goal_install_selector_optional(self->goal, sltr, &error);
}
} else {
if (pkg) {
- hy_goal_install(self->goal, pkg);
+ (void)hy_goal_install(self->goal, pkg);
} else {
- hy_goal_install_selector(self->goal, sltr, &error);
+ (void)hy_goal_install_selector(self->goal, sltr, &error);
}
}
return op_error2exc(error);
diff --git a/tests/libdnf/module/ModulePackageContainerTest.cpp b/tests/libdnf/module/ModulePackageContainerTest.cpp
index b2cf170..6360a0c 100644
--- a/tests/libdnf/module/ModulePackageContainerTest.cpp
+++ b/tests/libdnf/module/ModulePackageContainerTest.cpp
@@ -17,7 +17,8 @@ void ModulePackageContainerTest::setUp()
char *retptr = mkdtemp(tmpdir);
CPPUNIT_ASSERT(retptr);
char * etc_target = g_strjoin(NULL, tmpdir, "/etc", NULL);
- dnf_copy_recursive(TESTDATADIR "/modules/etc", etc_target, &error);
+ auto ret = dnf_copy_recursive(TESTDATADIR "/modules/etc", etc_target, &error);
+ g_assert_true(ret);
g_assert_no_error(error);
g_free(etc_target);
--
libgit2 1.0.1

View File

@ -0,0 +1,32 @@
From 263eee36afc0ae5c8f342f4b61038e91ee942b21 Mon Sep 17 00:00:00 2001
From: Marek Blaha <mblaha@redhat.com>
Date: Thu, 22 Apr 2021 15:19:26 +0200
Subject: [PATCH] hawkey: surrogateescape error handler to decode UTF-8 strings (RhBug:1893176)
This ensures that libdnf does not raise UnicodeDecodeError when
accessing package with non UTF-8 file names.
= changelog =
msg: DNF does not fail on non UTF-8 file names in a package
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1893176
---
python/hawkey/iutil-py.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/hawkey/iutil-py.cpp b/python/hawkey/iutil-py.cpp
index 56ccafd..57bef57 100644
--- a/python/hawkey/iutil-py.cpp
+++ b/python/hawkey/iutil-py.cpp
@@ -285,7 +285,7 @@ strlist_to_pylist(const char **slist)
return NULL;
for (const char **iter = slist; *iter; ++iter) {
- UniquePtrPyObject str(PyUnicode_FromString(*iter));
+ UniquePtrPyObject str(PyUnicode_DecodeUTF8(*iter, strlen(*iter), "surrogateescape"));
if (!str)
return NULL;
int rc = PyList_Append(list.get(), str.get());
--
libgit2 1.0.1

View File

@ -0,0 +1,28 @@
From 6eb68174565ce0402cead9e45053b560e819e982 Mon Sep 17 00:00:00 2001
From: Aleš Matěj <amatej@redhat.com>
Date: Tue, 21 Sep 2021 12:10:49 +0200
Subject: [PATCH] Turn off strict validation of modulemd documents (RhBug:2004853,2007166,2007167)
https://bugzilla.redhat.com/show_bug.cgi?id=2004853
https://bugzilla.redhat.com/show_bug.cgi?id=2007166
https://bugzilla.redhat.com/show_bug.cgi?id=2007167
---
libdnf/module/modulemd/ModuleMetadata.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdnf/module/modulemd/ModuleMetadata.cpp b/libdnf/module/modulemd/ModuleMetadata.cpp
index fbdd8a1..9dcd661 100644
--- a/libdnf/module/modulemd/ModuleMetadata.cpp
+++ b/libdnf/module/modulemd/ModuleMetadata.cpp
@@ -78,7 +78,7 @@ void ModuleMetadata::addMetadataFromString(const std::string & yaml, int priorit
g_autoptr(GPtrArray) failures = NULL;
ModulemdModuleIndex * mi = modulemd_module_index_new();
- gboolean success = modulemd_module_index_update_from_string(mi, yaml.c_str(), TRUE, &failures, &error);
+ gboolean success = modulemd_module_index_update_from_string(mi, yaml.c_str(), FALSE, &failures, &error);
if(!success){
ModuleMetadata::reportFailures(failures);
}
--
libgit2 1.0.1

View File

@ -0,0 +1,58 @@
From 551a83052ff92fa975f1015e2fc25b174f85b0e6 Mon Sep 17 00:00:00 2001
From: Aleš Matěj <amatej@redhat.com>
Date: Tue, 26 Oct 2021 09:33:51 +0200
Subject: [PATCH] Add unittest for setting up repo with empty keyfile (RhBug:1994614)
The test ensures we don't crash when the keyfile is empty/not loaded.
Test for: https://github.com/rpm-software-management/libdnf/commit/be66d0908d939ddaf3022c5489012bd1dbdb0075
RHEL bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1994614
Fedora bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1946024
---
tests/libdnf/dnf-self-test.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tests/libdnf/dnf-self-test.c b/tests/libdnf/dnf-self-test.c
index 32a21e6..5295837 100644
--- a/tests/libdnf/dnf-self-test.c
+++ b/tests/libdnf/dnf-self-test.c
@@ -199,6 +199,26 @@ ch_test_repo_func(void)
g_object_unref(context);
}
+static void
+dnf_repo_setup_with_empty_keyfile(void)
+{
+ DnfContext *context = dnf_context_new();
+ dnf_context_set_release_ver(context, "33");
+ DnfRepo *repo = dnf_repo_new(context);
+ GKeyFile *empty_key_file = g_key_file_new();
+
+ dnf_repo_set_keyfile(repo, empty_key_file);
+
+ GError *error = NULL;
+ // Empty key file is not an errror, there is just no configuration to be loaded.
+ g_assert(dnf_repo_setup(repo, &error));
+ g_assert_no_error(error);
+
+ g_object_unref(repo);
+ g_object_unref(context);
+ g_key_file_free(empty_key_file);
+}
+
static guint _allow_cancel_updates = 0;
static guint _action_updates = 0;
static guint _package_progress_updates = 0;
@@ -1217,6 +1237,7 @@ main(int argc, char **argv)
g_test_add_func("/libdnf/lock", dnf_lock_func);
g_test_add_func("/libdnf/lock[threads]", dnf_lock_threads_func);
g_test_add_func("/libdnf/repo", ch_test_repo_func);
+ g_test_add_func("/libdnf/repo_empty_keyfile", dnf_repo_setup_with_empty_keyfile);
g_test_add_func("/libdnf/state", dnf_state_func);
g_test_add_func("/libdnf/state[child]", dnf_state_child_func);
g_test_add_func("/libdnf/state[parent-1-step]", dnf_state_parent_one_step_proxy_func);
--
libgit2 1.1.0

View File

@ -0,0 +1,90 @@
From e83ff88f8e4604024e4d5f4fd9f2fa4e5d4f03f9 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Tue, 23 Nov 2021 14:14:23 +0100
Subject: [PATCH] Add getLatestModules()
It returns latest module packages for each module name, stream, and
architecture.
It is an alternative implementation to code base with
the old modular solver.
Alternative to 73868368120ceea97ada628a1aa42236fb42b89d
---
libdnf/module/ModulePackageContainer.cpp | 39 +++++++++++++++++++++++++++++++++++++++
libdnf/module/ModulePackageContainer.hpp | 9 +++++++++
2 files changed, 48 insertions(+)
diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index efab497..f9f861c 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -1037,6 +1037,45 @@ ModulePackageContainer::getLatestModulesPerRepo(ModuleState moduleFilter,
return output;
}
+std::vector<ModulePackage *>
+ModulePackageContainer::getLatestModules(const std::vector<ModulePackage *> modulePackages, bool activeOnly)
+{
+ std::vector<ModulePackage *> latestModules;
+ if (activeOnly) {
+ // When no active module return
+ if (!pImpl->activatedModules) {
+ return latestModules;
+ }
+ }
+ std::map<std::string, std::vector<ModulePackage *>> latest;
+
+ for (auto modulePackage : modulePackages) {
+ if (activeOnly && !isModuleActive(modulePackage)) {
+ continue;
+ }
+ auto nameStreamArch = modulePackage->getNameStream();
+ nameStreamArch.append(":");
+ nameStreamArch.append(modulePackage->getArchCStr());
+ auto & entries = latest[nameStreamArch];
+ if (entries.empty()) {
+ entries.push_back(modulePackage);
+ } else {
+ auto version = (*entries.begin())->getVersionNum();
+ if (version < modulePackage->getVersionNum()) {
+ entries.clear();
+ entries.push_back(modulePackage);
+ } else if (version == modulePackage->getVersionNum()) {
+ entries.push_back(modulePackage);
+ }
+ }
+ }
+ for (auto & entries : latest) {
+ for (auto modulePackage : entries.second) {
+ latestModules.push_back(modulePackage);
+ }
+ }
+ return latestModules;
+}
std::pair<std::vector<std::vector<std::string>>, ModulePackageContainer::ModuleErrorType>
ModulePackageContainer::resolveActiveModulePackages(bool debugSolver)
diff --git a/libdnf/module/ModulePackageContainer.hpp b/libdnf/module/ModulePackageContainer.hpp
index 7e5071b..42d5a9e 100644
--- a/libdnf/module/ModulePackageContainer.hpp
+++ b/libdnf/module/ModulePackageContainer.hpp
@@ -132,6 +132,15 @@ public:
std::vector<std::vector<std::vector<ModulePackage *>>> getLatestModulesPerRepo(
ModuleState moduleFilter, std::vector<ModulePackage *> modulePackages);
+ /**
+ * @brief Return all latest ModulePackages for each module Name, stream and architecture. In case of
+ * multiple latest packages, all will be returned. When activeOnly is true, it returns only the latest active
+ * packages.
+ *
+ * @return std::vector<ModulePackage *>
+ */
+ std::vector<ModulePackage *> getLatestModules(const std::vector<ModulePackage *> modulePackages, bool activeOnly);
+
std::vector<ModulePackage *> requiresModuleEnablement(const libdnf::PackageSet & packages);
/**
--
libgit2 1.1.0

File diff suppressed because it is too large Load Diff

1
EMPTY
View File

@ -1 +0,0 @@

842
libdnf.spec Normal file
View File

@ -0,0 +1,842 @@
%global libsolv_version 0.7.17
%global libmodulemd_version 2.11.2-2
%global librepo_version 1.13.1
%global dnf_conflict 4.3.0
%global swig_version 3.0.12
%global libdnf_major_version 0
%global libdnf_minor_version 63
%global libdnf_micro_version 0
%define __cmake_in_source_build 1
# set sphinx package name according to distro
%global requires_python2_sphinx python2-sphinx
%global requires_python3_sphinx python3-sphinx
%if 0%{?rhel} == 7
%global requires_python2_sphinx python-sphinx
%endif
%if 0%{?suse_version}
%global requires_python2_sphinx python2-Sphinx
%global requires_python3_sphinx python3-Sphinx
%endif
%bcond_with valgrind
# Do not build bindings for python3 for RHEL <= 7
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
# Disable python2 build by default
%bcond_with python2
%else
%bcond_without python2
%endif
%if 0%{?rhel} && ! 0%{?centos}
%bcond_without rhsm
%else
%bcond_with rhsm
%endif
%if 0%{?rhel}
%bcond_with zchunk
%else
%bcond_without zchunk
%endif
%bcond_with sanitizers
%global _cmake_opts \\\
-DENABLE_RHSM_SUPPORT=%{?with_rhsm:ON}%{!?with_rhsm:OFF} \\\
%{nil}
Name: libdnf
Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version}
Release: 8%{?dist}
Summary: Library providing simplified C and Python API to libsolv
License: LGPLv2+
URL: https://github.com/rpm-software-management/libdnf
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Revert-Improve-performance-for-module-query.patch
Patch2: 0002-Revert-Enhance-description-of-modular-solvables.patch
Patch3: 0003-Revert-Fix-typo-lates-latest.patch
Patch4: 0004-Revert-Remove-unused-code-bump-version.patch
Patch5: 0005-Revert-Report-a-new-type-of-the-module-resolve-error.patch
Patch6: 0006-Revert-Add-additional-fallback-for-module-resolve.patch
Patch7: 0007-Revert-Decide-how-to-handle-context-according-to-sta.patch
Patch8: 0008-Revert-Fix-load-update-FailSafe.patch
Patch9: 0009-Revert-Change-mechanism-of-module-conflicts.patch
Patch10: 0010-Revert-Call-addVersion2Modules-as-late-as-possible.patch
Patch11: 0011-Revert-Fix-modular-queries-with-the-new-solver.patch
Patch12: 0012-Revert-Add-compatible-layer-for-MdDocuments-v2.patch
Patch13: 0013-Revert-Add-an-alternative-constructor-for-ModulePack.patch
Patch14: 0014-Revert-Adjust-modular-solver-to-new-context-type.patch
Patch15: 0015-Revert-Change-usage-of-context-and-version-in-modula.patch
Patch16: 0016-Fix-failing-unittest-caused-by-the-revert-of-new-mod.patch
Patch17: 0017-Modify-unit-test-after-change-of-handling-advisories.patch
Patch18: 0018-Adjust-module-error-formatting-function-for-original.patch
Patch19: 0019-Remove-redundant-test.patch
Patch20: 0020-Fix-dnf_context_module_install-memory-leaks.patch
Patch21: 0021-covscan-remove-unused-vars-mark-private-func-static-return-values.patch
Patch22: 0022-hawkey-surrogateescape-error-handler-to-decode-UTF-8-strings-RhBug1893176.patch
Patch23: 0023-Turn-off-strict-validation-of-modulemd-documents-RhBug200485320071662007167.patch
Patch24: 0024-Add-unittest-for-setting-up-repo-with-empty-keyfile-RhBug1994614.patch
Patch25: 0025-Add-getLatestModules.patch
Patch26: 0026-Update-translations-RhBug-2017272.patch
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libsolv-devel >= %{libsolv_version}
BuildRequires: pkgconfig(librepo) >= %{librepo_version}
BuildRequires: pkgconfig(check)
%if %{with valgrind}
BuildRequires: valgrind
%endif
BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0
BuildRequires: pkgconfig(gtk-doc)
BuildRequires: rpm-devel >= 4.11.0
%if %{with rhsm}
BuildRequires: pkgconfig(librhsm) >= 0.0.3
%endif
%if %{with zchunk}
BuildRequires: pkgconfig(zck) >= 0.9.11
%endif
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(cppunit)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version}
BuildRequires: pkgconfig(smartcols)
BuildRequires: gettext
BuildRequires: gpgme-devel
%if %{with sanitizers}
BuildRequires: libasan
BuildRequires: liblsan
BuildRequires: libubsan
%endif
Requires: libmodulemd%{?_isa} >= %{libmodulemd_version}
Requires: libsolv%{?_isa} >= %{libsolv_version}
Requires: librepo%{?_isa} >= %{librepo_version}
%if %{without python2}
# Obsoleted from here so we can track the fast growing version easily.
# We intentionally only obsolete and not provide, this is a broken upgrade
# prevention, not providing the removed functionality.
Obsoletes: python2-%{name} < %{version}-%{release}
Obsoletes: python2-hawkey < %{version}-%{release}
Obsoletes: python2-hawkey-debuginfo < %{version}-%{release}
Obsoletes: python2-libdnf-debuginfo < %{version}-%{release}
%endif
%description
A Library providing simplified C and Python API to libsolv.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libsolv-devel%{?_isa} >= %{libsolv_version}
%description devel
Development files for %{name}.
%if %{with python2}
%package -n python2-%{name}
%{?python_provide:%python_provide python2-%{name}}
Summary: Python 2 bindings for the libdnf library.
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: python2-devel
%if !0%{?mageia}
BuildRequires: %{requires_python2_sphinx}
%endif
%if 0%{?rhel} == 7
BuildRequires: swig3 >= %{swig_version}
%else
BuildRequires: swig >= %{swig_version}
%endif
%description -n python2-%{name}
Python 2 bindings for the libdnf library.
%endif
# endif with python2
%if %{with python3}
%package -n python3-%{name}
%{?python_provide:%python_provide python3-%{name}}
Summary: Python 3 bindings for the libdnf library.
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: %{requires_python3_sphinx}
BuildRequires: swig >= %{swig_version}
%description -n python3-%{name}
Python 3 bindings for the libdnf library.
%endif
%if %{with python2}
%package -n python2-hawkey
Summary: Python 2 bindings for the hawkey library
%{?python_provide:%python_provide python2-hawkey}
BuildRequires: python2-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python2-%{name} = %{version}-%{release}
# Fix problem with hawkey - dnf version incompatibility
# Can be deleted for distros where only python2-dnf >= 2.0.0
Conflicts: python2-dnf < %{dnf_conflict}
Conflicts: python-dnf < %{dnf_conflict}
%description -n python2-hawkey
Python 2 bindings for the hawkey library.
%endif
# endif with python2
%if %{with python3}
%package -n python3-hawkey
Summary: Python 3 bindings for the hawkey library
%{?python_provide:%python_provide python3-hawkey}
BuildRequires: python3-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-%{name} = %{version}-%{release}
# Fix problem with hawkey - dnf version incompatibility
# Can be deleted for distros where only python3-dnf >= 2.0.0
Conflicts: python3-dnf < %{dnf_conflict}
# Obsoletes F27 packages
Obsoletes: platform-python-hawkey < %{version}-%{release}
%description -n python3-hawkey
Python 3 bindings for the hawkey library.
%endif
%prep
%autosetup -S git -p1
%if %{with python2}
mkdir build-py2
%endif
%if %{with python3}
mkdir build-py3
%endif
%build
%if %{with python2}
pushd build-py2
%if 0%{?mageia} || 0%{?suse_version}
cd ..
%define _cmake_builddir build-py2
%define __builddir build-py2
%endif
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF}
%make_build
popd
%endif
# endif with python2
%if %{with python3}
pushd build-py3
%if 0%{?mageia} || 0%{?suse_version}
cd ..
%define _cmake_builddir build-py3
%define __builddir build-py3
%endif
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF}
%make_build
popd
%endif
%check
%if %{with python2}
pushd build-py2
make ARGS="-V" test
popd
%endif
%if %{with python3}
# If we didn't run the general tests yet, do it now.
%if %{without python2}
pushd build-py3
make ARGS="-V" test
popd
%else
# Otherwise, run just the Python tests, not all of
# them, since we have coverage of the core from the
# first build
pushd build-py3/python/hawkey/tests
make ARGS="-V" test
popd
%endif
%endif
%install
%if %{with python2}
pushd build-py2
%make_install
popd
%endif
%if %{with python3}
pushd build-py3
%make_install
popd
%endif
%find_lang %{name}
%if (0%{?rhel} && 0%{?rhel} <= 7) || 0%{?suse_version}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%else
%ldconfig_scriptlets
%endif
%files -f %{name}.lang
%license COPYING
%doc README.md AUTHORS
%{_libdir}/%{name}.so.*
%dir %{_libdir}/libdnf/
%dir %{_libdir}/libdnf/plugins/
%{_libdir}/libdnf/plugins/README
%if %{with sanitizers}
%{_sysconfdir}/profile.d/dnf-sanitizers.sh
%endif
%files devel
%doc %{_datadir}/gtk-doc/html/%{name}/
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}/
%if %{with python2}
%files -n python2-%{name}
%{python2_sitearch}/%{name}/
%endif
%if %{with python3}
%files -n python3-%{name}
%{python3_sitearch}/%{name}/
%endif
%if %{with python2}
%files -n python2-hawkey
%{python2_sitearch}/hawkey/
%endif
%if %{with python3}
%files -n python3-hawkey
%{python3_sitearch}/hawkey/
%endif
%changelog
* Fri Mar 18 2022 Marek Blaha <mblaha@redhat.com> - 0.63.0-8
- Update translations
* Fri Jan 14 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 0.63.0-7
- Rebuild with new release number
* Tue Jan 11 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 0.63.0-6
- Add getLatestModules()
* Mon Nov 29 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 0.63.0-5
- Add unittest for setting up repo with empty keyfile (RhBug:1994614)
* Tue Nov 09 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 0.63.0-4
- Bump release number because of conflicting version of 8.5 build
* Tue Nov 09 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 0.63.0-3
- Turn off strict validation of modulemd documents (RhBug:2004853,2007166,2007167)
* Tue Jul 27 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 0.63.0-2
- Fix: dnf_context_module_install: memory leaks
- covscan: remove unused vars, mark private func static, return values
- DNF does not fail on non UTF-8 file names in a package
* Wed May 19 2021 Pavla Kratochvilova <pkratoch@redhat.com> - 0.63.0-1
- Update to 0.62.0
- Hardening: add signature check with rpmcliVerifySignatures (RhBug:1932079)
- Support allow_vendor_change setting in dnf context API
- Add a new option module_obsoletes
- Add new API applyObsoletes() function to apply modular obsoletes
- Do not allow 1 as installonly_limit value (RhBug:1926261)
- Add a config option to check TLS certificate revocation status (using OCSP stapling), defaults to false (RhBug:1814383)
- Swdb: Add a method to get the current transaction
- [context,API] Functions for accessing main/global configuration options
- [context,API] Function for adding setopt
- Add getter for modular obsoletes from ModuleMetadata
- Add ModulePackage.getStaticContext() and getRequires()
- Fix modular queries with the new solver
- Fix: Fully set ssl in newHandle function
- [conf] Add options for working with certificates used with proxy
- Modify module NSVCA parsing - context definition (RhBug:1926771)
- [context] Fix: dnf_package_is_installonly (RhBug:1928056)
- Add getApplicablePackages to advisory and isApplicable to advisorymodule
- Keep isAdvisoryApplicable to preserve API
- [context] Support config file option "proxy_auth_method", defaults "any"
- Support main config file options "installonlypkgs" and "protected_packages". Changes behaviour of microdnf and PackageKit.
- Properly handle multiple collections in updateinfo.xml (RhBug:1804234)
- Fix a crash when [media] section in .treeinfo is missing for bootable media (RhBug:1946024)
- Add new dnf_context_module_install() C API
* Fri Feb 12 2021 Nicola Sella <nsella@redhat.com> - 0.55.0-6
- Fix removal step during modular enable in context part
* Thu Feb 11 2021 Nicola Sella <nsella@redhat.com> - 0.55.0-5
- Add new option module_stream_switch
* Mon Feb 08 2021 Nicola Sella <nsella@redhat.com> - 0.55.0-4
- [context] improve retrieving repository configuration
- Allow loading incomplete cache and loading ext solv files without its repodata
* Fri Jan 29 2021 Nicola Sella <nsella@redhat.com> - 0.55.0-3
- Avoid multilib file conflict in config.h (RhBug:1918818)
- [modules] Add special handling for src artifacts (RhBug:1809314)
* Fri Jan 15 2021 Nicola Sella <nsella@redhat.com> - 0.55.0-2
- Better msgs if "basecachedir" or "proxy_password" isn't set (RhBug:1888946)
* Mon Nov 09 2020 Nicola Sella <nsella@redhat.com> - 0.55.0-1
- Add vendor to dnf API (RhBug:1876561)
- Add formatting function for solver error
- Add error types in ModulePackageContainer
- Implement module enable for context part
- Improve string formatting for translation
- Remove redundant printf and change logging info to notice (RhBug:1827424)
- Add allow_vendor_change option (RhBug:1788371) (RhBug:1788371)
* Thu Aug 20 2020 Nicola Sella <nsella@redhat.com> - 0.48.0-5
- [covscan] Handle exception in a python binding by the proper function (RhBug:1870492)
* Tue Jul 28 2020 Marek Blaha <mblaha@redhat.com> - 0.48.0-4
- Update translations (RhBug:1820548)
* Fri Jul 17 2020 Nicola Sella <nsella@redhat.com> - 0.48.0-3
- Add log file level main config option (RhBug:1802074)
- Accept '==' as an operator in reldeps (RhBug:1847946)
* Wed Jun 10 2020 Ales Matej <amatej@redhat.com> - 0.48.0-2
- [history] Fix dnf history rollback when a package was removed (RhBug:1683134)
* Wed Jun 03 2020 Nicola Sella <nsella@redhat.com> - 0.48.0-1
- Update to 0.48.0
- swdb: Catch only SQLite3 exceptions and simplify the messages
- MergedTransaction list multiple comments (RhBug:1773679)
- Modify CMake to pull *.po files from weblate
- Optimize DependencyContainer creation from an existing queue
- fix a memory leak in dnf_package_get_requires()
- Fix memory leaks on g_build_filename()
- Fix memory leak in dnf_context_setup()
- Add `hy_goal_favor` and `hy_goal_disfavor`
- Define a cleanup function for `DnfPackageSet`
- dnf-repo: fix dnf_repo_get_public_keys double-free
- Do not cache RPMDB
- Use single-quotes around string literals used in SQL statements
- SQLite3: Do not close the database if it wasn't opened (RhBug:1761976)
- Don't create a new history DB connection for in-memory DB
- transaction/Swdb: Use a single logger variable in constructor
- utils: Add a safe version of pathExists()
- swdb: Handle the case when pathExists() fails on e.g. permission
- Repo: prepend "file://" if a local path is used as baseurl
- Move urlEncode() to utils
- utils: Add 'exclude' argument to urlEncode()
- Encode package URL for downloading through librepo (RhBug:1817130)
- Replace std::runtime_error with libdnf::RepoError
- Fixes and error handling improvements of the File class
- [context] Use ConfigRepo for gpgkey and baseurl (RhBug:1807864)
- [context] support "priority" option in .repo config file (RhBug:1797265)
* Fri Apr 03 2020 Ales Matej <amatej@redhat.com> - 0.47.0-1
- Update to 0.47.0
- Allow excluding packages with "excludepkgs" and globs
- Make parsing of reldeps more strict (RhBug:1788107)
- Add expanding solvable provides for dependency matching (RhBug:1534123)
- DnfRepo: fix module_hotfixes keyfile priority level
- Add custom exceptions to libdnf interface
- Port to libmodulemd-2 API (RhBug:1693683)
- Add prereq_ignoreinst & regular_requires properties for pkg (RhBug:1543449)
- Reset active modules when no module enabled or default (RhBug:1767351)
- Add comment option to transaction (RhBug:1773679)
- Baseurl is not exclusive with mirrorlist/metalink (RhBug:1775184)
- Add new function to reset all modules in C API (dnf_context_reset_all_modules)
- Handle situation when an unprivileged user cannot create history database (RhBug:1634385)
- Add query filter: latest by priority
- Add setter for running kernel protection setting
- Add DNF_NO_PROTECTED flag to allow empty list of protected packages
- Config options: only first empty value clears existing (RhBug:1788154)
- [conf] Set useful default colors when color is enabled
- [context] Use installonly_limit from global config (RhBug:1256108)
- [context] Add API to get/set "install_weak_deps"
- [context] Adds support for includepkgs in repository configuration.
- [context] Adds support for excludepkgs, exclude, includepkgs, and disable_excludes in main configuration.
- [context] Added function dnf_transaction_set_dont_solve_goal
- [context] Added functions dnf_context_get/set_config_file_path
- [context] Respect "plugins" global conf value
- [context] Add API to disable/enable plugins
- [context] Create new repo instead of reusing old one (RhBug:1795004)
- [context] Error when main config file can't be opened (RhBug:1794864)
- [context] Add function function dnf_context_is_set_config_file_path
- [context] Support repositories defined in main configuration file
* Tue Feb 18 2020 Ales Matej <amatej@redhat.com> - 0.39.1-5
- Fix filtering of packages by advisory (RhBug:1770125)
* Fri Jan 31 2020 Marek Blaha <mblaha@redhat.com> - 0.39.1-4
- [translations] Update translations from zanata (RhBug:1754965)
* Mon Jan 13 2020 Ales Matej <amatej@redhat.com> - 0.39.1-3
- Add two new query filters: obsoletes_by_priority, upgrades_by_priority (RhBug:1769466)
- [context] Add wildcard support in dnf_context_repo_set_data (RhBug:1781420)
- Remove killGpgAgent function (RhBug:1781601)
* Thu Dec 12 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.39.1-2
- [user-agent] Stop checking os-release(5) data against a hard-coded whitelist (RhBug:1777255)
* Mon Nov 25 2019 Ales Matej <amatej@redhat.com> - 0.39.1-1
- Update to 0.39.1
- Report reason how package was excluded (RhBug:1649754)
- Additional Arm detection improvements (RhBug:1691430)
- Set skip_if_unavailable for media repos to skip their update (RhBug:1716067)
- Add support of xml:base for remote and local url in context (RhBug:1734350,1717865)
* Wed Nov 13 2019 Ales Matej <amatej@redhat.com> - 0.38.1-1
- Update to 0.38.1
- Change the best option default to false
- Use more descriptive message when failed to retrieve GPG key (RhBug:1605117)
- Add removeMetadataTypeFromDownload function to the API
- Context part of libdnf can now read vars (urlvars) from dirs and environment
- Throw exception immediately if file cannot be opened
- Add test when there is no primary metadata in compatible format (RhBug:1744960)
- Various improvements to countme features
- Don't abort on rpmdb checksum calculation failure
- Enable module dependency trees when using set_modules_enabled_by_pkgset() (RhBug:1762314)
- Resolve problem with --best and search in provides (RhBug:1737469)
- New method "Query::filterSubject()", replaces Solution::getBestSolution()
- The Solution class was removed
- Add query argument into get_best_query and get_best_solution
- Add module reset function into dnf_context
- Add method to get all repository metadata locations
- Catch NoModuleException in case of not existent value was used in persistor (RhBug:1761773)
* Tue Oct 22 2019 Ales Matej <amatej@redhat.com> - 0.35.5-1
- Update to 0.35.5
- Make libdnf own its plugin directory (RhBug:1714265)
- Set priority of dnf.conf.d drop-ins
- Fix toString() to not insert [] (RhBug:1584442)
- Fix handling large number of filenames on input (RhBug:1690915)
- Detect armv7 with crypto extension only on arm version >= 8
- A new standardized User-Agent field consisting of the libdnf and OS version
(including the variant) (RhBug:1156007)
- Add basic countme support (RhBug:1647454)
- Fix crash in PackageKit (RhBug:1636803)
- Do not create @System.solv files (RhBug:1707995)
- Set LRO_CACHEDIR so zchunk works again (RhBug:1739867)
- Improve detection of extras packages by comparing (name, arch) pair instead
of full NEVRA (RhBuh:1684517)
- Improve handling multilib packages in the history command (RhBug:1728637)
- Repo download: use full error description into the exception text (RhBug:1741442)
- Properly close hawkey.log (RhBug:1594016)
- Fix dnf updateinfo --update to not list advisories for packages updatable
only from non-enabled modules
- Apply modular filtering by package name (RhBug:1702729)
* Wed Oct 16 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.35.1-9
- Prevent reinstalling modified packages with same NEVRA (RhBug:1728252,1644241,1760825)
* Fri Sep 06 2019 Marek Blaha <mblaha@redhat.com> - 0.35.1-8
- Enhanced fix of moving directories in minimal container (RhBug:1700341)
* Thu Sep 05 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.35.1-7
- Remove patch to not fail when installing modular RPMs without modular metadata
* Thu Sep 05 2019 Marek Blaha <mblaha@redhat.com> - 0.35.1-6
- Fix moving directories in minimal container (RhBug:1700341)
* Tue Aug 06 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.35.1-5
- Add suport for query sequence conversions
* Thu Aug 01 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.35.1-4
- Fix typo in error message (RhBug:1726661)
- Update localizations from zanata (RhBug:1689991)
- Don't disable nonexistent but required repositories (RhBug:1689331)
- Ignore trailing blank lines of multiline value (RhBug:1722493)
- Re-size includes map before re-computation (RhBug:1725213)
* Tue Jul 16 2019 Marek Blaha <mblaha@redhat.com> - 0.35.1-3
- Fix attaching and detaching of libsolvRepo and repo_internalize_trigger()
(RhBug:1730224)
* Thu Jul 04 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.35.1-2
- Add patch to not fail when installing modular RPMs without modular metadata
* Tue Jun 11 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.35.1-1
- Update to 0.35.1
- Skip invalid key files in "/etc/pki/rpm-gpg" with warning (RhBug:1644040)
- Enable timestamp preserving for downloaded data (RhBug:1688537)
- Fix 'database is locked' error (RhBug:1631533)
- Replace the 'Failed to synchronize cache' message (RhBug:1712055)
- Fix 'no such table: main.trans_cmdline' error (RhBug:1596540)
- Fix: skip_if_unavailable=true for local repositories (RhBug:1716313)
- Add support of modular FailSafe (RhBug:1623128)
- Add support of DNF main config file in context; used by PackageKit and
microdnf (RhBug:1689331)
- Exit gpg-agent after repokey import (RhBug:1650266)
* Mon May 13 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.33.0-1
- Update to 0.33.0
- Enhance sorting for module list (RhBug:1590358)
- [DnfRepo] Add methods for alternative repository metadata type and download (RhBug:1656314)
- Remove installed profile on module enable or disable (RhBug:1653623)
- Enhance modular solver to handle enabled and default module streams differently (RhBug:1648839)
- Add support of wild cards for modules (RhBug:1644588)
- Exclude module pkgs that have conflict
- Enhance config parser to preserve order of data, and keep comments and format
- Improve ARM detection
- Add support for SHA-384
- Return empty query if incorrect reldep (RhBug:1687135)
- ConfigParser: Improve compatibility with Python ConfigParser and dnf-plugin-spacewalk (RhBug:1692044)
- ConfigParser: Unify default set of string represenation of boolean values
- Fix segfault when interrupting dnf process (RhBug:1610456)
- Installroot now requires absolute path
- Support "_none_" value for repo option "proxy" (RhBug:1680272)
- Add support for Module advisories
- Add support for xml:base attribute from primary.xml (RhBug:1691315)
- Improve detection of Platform ID (RhBug:1688462)
* Fri Apr 26 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.22.5-6
- Rebuild for libsolv soname bump (in libsolve update to 0.7.4)
* Wed Apr 03 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.22.5-5
- Backport patches to set default to skip_if_unavailable to false (RhBug:1692452)
* Tue Feb 12 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.22.5-4
- Backport patch to exclude module pkgs that have conflict (RhBug:1670496)
* Fri Feb 08 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.22.5-3
- Backport patches to add support for modular updateinfoxml applicability
* Wed Feb 06 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.22.5-2
- Add patch: Add best as default behavior (RhBug1670776)
* Mon Dec 17 2018 Daniel Mach <dmach@redhat.com> - 0.22.4-1
- Enhance LIBDNF plugins support
- [repo] Check whether metadata cache is expired (RhBug:1539620,1648274)
- [sack] Implement dnf_sack_get_rpmdb_version()
* Fri Nov 23 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.3-1
- Permanently disable Python2 build for Fedora 30+
- Update to 0.22.3
- Modify solver_describe_decision to report cleaned (RhBug:1486749)
- [swdb] create persistent WAL files (RhBug:1640235)
- Relocate ModuleContainer save hook (RhBug:1632518)
- [transaction] Fix transaction item lookup for obsoleted packages (RhBug: 1642796)
- Fix memory leaks and memory allocations
- [repo] Possibility to extend downloaded repository metadata
* Wed Oct 24 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.0-2
- Add patch Modify-solver_describe_decision-to-report-cleaned-RhBug1486749
- Add patch swdb-create-persistent-WAL-files-RhBug1640235
- Add patch Relocate-ModuleContainer-save-hook-RhBug1632518
- Add patch Test-if-sack-is-present-and-run-save-module-persistor-RhBug1632518
* Mon Oct 15 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.0-1
- Fix segfault in repo_internalize_trigger (RhBug:1375895)
- Change sorting of installonly packages (RhBug:1627685)
- [swdb] Fixed pattern searching in history db (RhBug:1635542)
- Check correctly gpg for repomd when refresh is used (RhBug:1636743)
- [conf] Provide additional VectorString methods for compatibility with Python list.
- [plugins] add plugin loading and hooks into libdnf
* Tue Sep 25 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.20.0-1
- [module] Report module solver errors
- [module] Enhance module commands and errors
- [transaction] Fixed several problems with SWDB
- Remove unneeded regex URL tests (RhBug:1598336)
- Allow quoted values in ini files (RhBug:1624056)
- Filter out not unique set of solver problems (RhBug:1564369)
- Resolves: rhbz#1614531 - dnf 3.2 does not depsolve correctly
- Resolves: rhbz#1614346 - dnf rollback doesn't work after install/downgrade/upgrade
- bug 1605274 - DNF crashes on * in installation repository URL
- Resolves: rhbz#1623383 - dnf.exceptions.ConfigError: Error parsing ...
* Mon Sep 10 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.19.1-1
- Fix compilation errors on gcc-4.8.5
- [module] Allow module queries on disabled modules (RhBug:1627081)
* Fri Sep 07 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.19.0-1
- [query] Reldeps can contain a space char (RhBug:1612462)
- [transaction] Avoid adding duplicates via Transaction::addItem()
- Fix compilation errors on gcc-4.8.5
- [module] Make available ModuleProfile using SWIG
- [module] Redesign module disable and reset
* Fri Aug 31 2018 Daniel Mach <dmach@redhat.com> - 0.18.0-1
- [repo] Implement GPG key import
- [repo] Introduce Repo class replacing dnf.repo.Repo
- [context] Fix memory corruption in dnf_context
- [rhsm] Fix: RHSM don't write .repo file with same content (RhBug:1600452)
- [module] Create /etc/dnf/modules.d if it doesn't exist.
- [module] Forward C++ exceptions to bindings.
* Thu Aug 16 2018 Daniel Mach <dmach@redhat.com> - 0.17.2-2
- [module] Create /etc/dnf/modules.d if it doesn't exist.
- [module] Forward C++ exceptions to bindings.
* Mon Aug 13 2018 Daniel Mach <dmach@redhat.com> - 0.17.2-1
- [sqlite3] Change db locking mode to DEFAULT.
- [doc] Add libsmartcols-devel to devel deps.
* Mon Aug 13 2018 Daniel Mach <dmach@redhat.com> - 0.17.1-1
- [module] Solve a problem in python constructor of NSVCAP if no version.
- [translations] Update translations from zanata.
- [transaction] Fix crash after using dnf.comps.CompsQuery and forking the process in Anaconda.
- [module] Support for resetting module state.
- [output] Introduce wrapper for smartcols.
* Tue Aug 07 2018 Daniel Mach <dmach@redhat.com> - 0.17.0-1
- [conf] Add module_platform_id option.
- [module] Add ModulePackageContainer class.
- [module] Add ModulePersistor class.
- [sack] Module filtering made available in python API
- [sack] Module auto-enabling according to installed packages
* Fri Jul 27 2018 Daniel Mach <dmach@redhat.com> - 0.16.1-1
- [module] Implement 'module_hotfixes' conf option to skip filtering RPMs from hotfix repos.
- [goal] Fix distupgrade filter, allow downgrades.
- [context] Allow to set module platform in context.
- [module] Introduce proper modular dependency solving.
- [module] Platform pseudo-module based on /etc/os-release.
- [goal] Add Goal::listSuggested().
- [l10n] Support for translations, add gettext build dependency.
* Sun Jul 22 2018 Daniel Mach <dmach@redhat.com> - 0.16.0-1
- Fix RHSM plugin
- Add support for logging
- Bump minimal libmodulemd version to 1.6.1
* Mon Jul 09 2018 Igor Gnatenko <ignatenko@redhat.com> - 0.15.2-2
- Fix librhsm support logic
* Fri Jun 29 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.15.2-1
- Update to 0.15.1
- Resolves: rhbz#1595487
* Fri Jun 29 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.15.1-2
- Restore proper ldconfig_scriptlets
* Tue Jun 26 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.15.1-1
- Update to 0.15.1
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 0.11.1-6
- Rebuilt for Python 3.7
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Jan 30 2018 Igor Gnatenko <ignatenko@redhat.com> - 0.11.1-4
- Switch to %%ldconfig_scriptlets
* Tue Nov 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.11.1-3
- Use better Obsoletes for platform-python
* Fri Nov 03 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.11.1-2
- Remove platform-python subpackage
* Mon Oct 16 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.11.1-1
- Rerelease of 0.11.1-1
- Improvement query performance
- Run file query in hy_subject_get_best_solution only for files (arguments that start with ``/`` or
``*/``)
- Resolves: rhbz#1498207 - DNF crash during upgrade installation F26 -> F27
* Tue Oct 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.11.0-1
- Update to 0.11.0
* Mon Oct 02 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.10.1-2
- Rerelease of 0.10.1-1
* Wed Sep 27 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.10.1-1
- Update to 0.10.1
- It improves query performance with name and arch filters. Also nevra filter will now
handle string with or without epoch.
- Additionally for python bindings it renames NEVRA._has_just_name() to NEVRA.has_just_name() due
to movement of code into c part of library.
- Resolves: rhbz#1260242 - --exclude does not affect dnf remove's removal of requirements
- Resolves: rhbz#1485881 - DNF claims it cannot install package, which have been already installed
- Resolves: rhbz#1361187 - [abrt] python-ipython-console: filter_updown(): python3.5 killed by SIGABRT
* Fri Sep 15 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-8
- Disable platform python on old releases
* Tue Aug 15 2017 Lumír Balhar <lbalhar@redhat.com> - 0.9.3-7
- Add platform-python subpackage
* Fri Aug 11 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-6
- Rebuilt after RPM update (№ 3)
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-5
- Rebuilt for RPM soname bump
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-4
- Rebuilt for RPM soname bump
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon Jul 24 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.3-1
- Update to 0.9.3
* Sat Jul 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.2-1
- Update to 0.9.2
* Mon Jun 12 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.1-1
- Update to 0.9.1
* Mon May 22 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.0-1
- Update to 0.9.0
* Tue May 02 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.8.2-1
- Update to 0.8.2
* Fri Mar 24 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.8.1-1
- Update to 0.8.1
* Tue Mar 21 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.8.0-1
- Update to 0.8.0
* Mon Feb 20 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.4-1
- Update to 0.7.4
* Fri Feb 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.3-1
- Update to 0.7.3
* Wed Feb 08 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.2-1
- 0.7.2
* Fri Jan 06 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.1-1
- 0.7.1
* Wed Dec 21 2016 Peter Robinson <pbrobinson@fedoraproject.org> 0.7.0-0.7gitf9b798c
- Rebuild for Python 3.6
* Mon Dec 19 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.7.0-0.6gitf9b798c
- Use new upstream URL
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 0.7.0-0.5gitf9b798c
- Rebuild for Python 3.6
* Tue Dec 06 2016 Martin Hatina <mhatina@redhat.com> - 0.7.0-0.4gitf9b798c
- Increase conflict version of dnf
* Thu Dec 01 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.7.0-0.3gitf9b798c
- Update to latest snapshot
* Fri Nov 04 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.7.0-0.2git8bd77f8
- Update to latest snapshot
* Thu Sep 29 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.7.0-0.1git179c0a6
- Initial package

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (libdnf-0.63.0.tar.gz) = 0a2b1cab40c0dbce664ff7c13d04d9f1bd3a197558d4ba734f0851f8e5f512a81b9763196bb1a4283a440d82c809085a56cfb782f22a76ae7f3471e66e06709f