diff --git a/0008-ConfigParser-make-splitReleasever-public.patch b/0008-ConfigParser-make-splitReleasever-public.patch new file mode 100644 index 0000000..947af4b --- /dev/null +++ b/0008-ConfigParser-make-splitReleasever-public.patch @@ -0,0 +1,80 @@ +From 73ec298e31c8cd21fe5761a2e838951b2efdbf6f Mon Sep 17 00:00:00 2001 +From: Evan Goode +Date: Tue, 21 Jan 2025 19:19:06 +0000 +Subject: [PATCH] ConfigParser: make splitReleasever public + +Upstream commit: 522793b258da0b1f70c1f380b2c01ddfd27bc193 +Resolves: https://issues.redhat.com/browse/RHEL-68034 +--- + bindings/swig/conf.i | 1 + + libdnf/conf/ConfigParser.cpp | 6 +++--- + libdnf/conf/ConfigParser.hpp | 3 +-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/bindings/swig/conf.i b/bindings/swig/conf.i +index b6a0ce88..c42d5673 100644 +--- a/bindings/swig/conf.i ++++ b/bindings/swig/conf.i +@@ -199,6 +199,7 @@ public: + std::string & getHeader() noexcept; + const Container & getData() const noexcept; + Container & getData() noexcept; ++ static std::pair splitReleasever(const std::string & releasever); + }; + } + %clear std::string & text; +diff --git a/libdnf/conf/ConfigParser.cpp b/libdnf/conf/ConfigParser.cpp +index 977da757..186acdc8 100644 +--- a/libdnf/conf/ConfigParser.cpp ++++ b/libdnf/conf/ConfigParser.cpp +@@ -103,7 +103,7 @@ std::pair ConfigParser::substitute_expression(const std::st + if (variable_key == "releasever_major" || variable_key == "releasever_minor") { + const auto releasever_mapping = substitutions.find("releasever"); + if (releasever_mapping != substitutions.end()) { +- const auto & releasever_split = ConfigParser::split_releasever(releasever_mapping->second); ++ const auto & releasever_split = ConfigParser::splitReleasever(releasever_mapping->second); + if (variable_key == "releasever_major") { + variable_value = std::get<0>(releasever_split); + variable_value_has_value = true; +@@ -231,7 +231,7 @@ std::pair ConfigParser::substitute_expression(const std::st + return std::make_pair(res, text.length()); + } + +-std::tuple ConfigParser::split_releasever(const std::string & releasever) ++std::pair ConfigParser::splitReleasever(const std::string & releasever) + { + // Uses the same logic as DNF 5 and as splitReleaseverTo in libzypp + std::string releasever_major; +@@ -243,7 +243,7 @@ std::tuple ConfigParser::split_releasever(const std::s + releasever_major = releasever.substr(0, pos); + releasever_minor = releasever.substr(pos + 1); + } +- return std::make_tuple(releasever_major, releasever_minor); ++ return std::make_pair(releasever_major, releasever_minor); + } + + static void read(ConfigParser & cfgParser, IniParser & parser) +diff --git a/libdnf/conf/ConfigParser.hpp b/libdnf/conf/ConfigParser.hpp +index 584bd268..de8a0c9d 100644 +--- a/libdnf/conf/ConfigParser.hpp ++++ b/libdnf/conf/ConfigParser.hpp +@@ -140,6 +140,7 @@ public: + std::string & getHeader() noexcept; + const Container & getData() const noexcept; + Container & getData() noexcept; ++ static std::pair splitReleasever(const std::string & releasever); + + private: + std::map substitutions; +@@ -159,8 +160,6 @@ private: + static std::pair substitute_expression(const std::string & text, + const std::map & substitutions, + unsigned int depth); +- +- static std::tuple split_releasever(const std::string & releasever); + }; + + inline void ConfigParser::setSubstitutions(const std::map & substitutions) +-- +2.48.1 + diff --git a/libdnf.spec b/libdnf.spec index 500ec84..15acc75 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -56,7 +56,7 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 7%{?dist}.alma.1 +Release: 8%{?dist}.alma.1 Summary: Library providing simplified C and Python API to libsolv License: LGPL-2.1-or-later URL: https://github.com/rpm-software-management/libdnf @@ -68,6 +68,7 @@ Patch4: 0004-Set-pool-flag-to-fix-pool_addfileprovides_queue-with.patch Patch5: 0005-ConfigParser-fix-use-out-of-scope-leaks.patch Patch6: 0006-Add-tests-for-shell-style-variable-expansion.patch Patch7: 0007-Add-persistence-config-option.patch +Patch8: 0008-ConfigParser-make-splitReleasever-public.patch # AlmaLinux Patch Patch1001: 0001-Add-link-to-AlmaLinux-bugtracker.patch @@ -316,11 +317,14 @@ popd %endif %changelog -* Tue Feb 11 2025 Eduard Abdullin - 0.73.1-7.alma.1 +* Fri Mar 07 2025 Eduard Abdullin - 0.73.1-8.alma.1 - Add x86_64_v2 to arch_map - Add link to AlmaLinux bugtracker - Fix tests on x86_64_v2 +* Fri Feb 07 2025 Carl George - 0.73.1-8 +- ConfigParser: make splitReleasever public (RHEL-68034) + * Wed Feb 05 2025 Petr Pisar - 0.73.1-7 - Add persistence configuration option (RHEL-78034)