diff --git a/0024-Add-deprecation-warning-for-module-commands.patch b/0024-Add-deprecation-warning-for-module-commands.patch new file mode 100644 index 0000000..f2095d2 --- /dev/null +++ b/0024-Add-deprecation-warning-for-module-commands.patch @@ -0,0 +1,34 @@ +From f939a23c1d8436365e7587258f264e79b014befc Mon Sep 17 00:00:00 2001 +From: Evan Goode +Date: Mon, 14 Jul 2025 17:31:04 +0000 +Subject: [PATCH 1/2] Add deprecation warning for module commands + +For: https://issues.redhat.com/browse/RHEL-89940 +--- + dnf/cli/commands/module.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dnf/cli/commands/module.py b/dnf/cli/commands/module.py +index b1396360e..88dc8b23c 100644 +--- a/dnf/cli/commands/module.py ++++ b/dnf/cli/commands/module.py +@@ -349,7 +349,7 @@ class ModuleCommand(commands.Command): + SUBCMDS_NOT_REQUIRED_ARG = {ListSubCommand} + + aliases = ("module",) +- summary = _("Interact with Modules.") ++ summary = _("Interact with Modules. WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.") + + def __init__(self, cli): + super(ModuleCommand, self).__init__(cli) +@@ -389,6 +389,7 @@ class ModuleCommand(commands.Command): + help=_("Module specification")) + + def configure(self): ++ logger.warning(_("WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.")) + try: + self.subcmd = self._subcmd_name2obj[self.opts.subcmd[0]] + except (CliError, KeyError): +-- +2.50.1 + diff --git a/0025-Add-modularity-deprecation-warning-to-doc-pages.patch b/0025-Add-modularity-deprecation-warning-to-doc-pages.patch new file mode 100644 index 0000000..3b23784 --- /dev/null +++ b/0025-Add-modularity-deprecation-warning-to-doc-pages.patch @@ -0,0 +1,57 @@ +From 244d46c247bcac729cd84f7454157b86982e2233 Mon Sep 17 00:00:00 2001 +From: Evan Goode +Date: Mon, 14 Jul 2025 17:37:56 +0000 +Subject: [PATCH 2/2] Add modularity deprecation warning to doc pages + +--- + doc/api_module.rst | 2 ++ + doc/command_ref.rst | 2 ++ + doc/modularity.rst | 3 ++- + 3 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/doc/api_module.rst b/doc/api_module.rst +index e2a5c6a11..6d84e214b 100644 +--- a/doc/api_module.rst ++++ b/doc/api_module.rst +@@ -19,6 +19,8 @@ + Modularity Interface + ===================== + ++.. warning:: Modularity is deprecated, and functionality will be removed in a future release of DNF5. ++ + .. module:: dnf.module.module_base + + +diff --git a/doc/command_ref.rst b/doc/command_ref.rst +index f7b8e22c8..4e3077283 100644 +--- a/doc/command_ref.rst ++++ b/doc/command_ref.rst +@@ -1025,6 +1025,8 @@ Module Command + + | Command: ``module`` + ++.. warning:: Modularity is deprecated, and functionality will be removed in a future release of DNF5. ++ + Modularity overview is available at :ref:`man page dnf.modularity(7) `. + Module subcommands take :ref:`\\ `... arguments that specify modules or profiles. + +diff --git a/doc/modularity.rst b/doc/modularity.rst +index 8ebd07e23..3683bc608 100644 +--- a/doc/modularity.rst ++++ b/doc/modularity.rst +@@ -21,10 +21,11 @@ + Modularity + ############ + ++.. warning:: Modularity is deprecated, and functionality will be removed in a future release of DNF5. ++ + Modularity is new way of building, organizing and delivering packages. + For more details see: https://docs.pagure.org/modularity/ + +- + ============= + Definitions + ============= +-- +2.50.1 + diff --git a/0026-automatic-Fix-detecting-releasever_minor.patch b/0026-automatic-Fix-detecting-releasever_minor.patch new file mode 100644 index 0000000..8660c0d --- /dev/null +++ b/0026-automatic-Fix-detecting-releasever_minor.patch @@ -0,0 +1,92 @@ +From ed51df30350eadc77688d3a44184b5fdb8db9b97 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 28 Jul 2025 17:25:09 +0200 +Subject: [PATCH] automatic: Fix detecting releasever_minor +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream commit: b7eb2e399c42d10444f7d045689fd50f91cf72db + +When running dnf-automatic in RHEL 10.0 where releasever_minor should +default to "0", releasever_minor variable was incorrectly detected as +undefined. That led to expanding a metalink for an EPEL repository to +a wrong URL. + +The cause was a bad logic in updating the release, releasever_major, +and releasever_minor triplet in dnf.cli.cli.Cli._read_conf_file(): +Setting release invalidates releasever_major and releasever_minor. At +the same time for backward compatibilty detected release only contains +the major number. + +This bug did not manifest in "dnf upgrade" command because "dnf" +program does not explicitly construct dnf.Base() before calling +_read_conf_file(). That is dnf-automtic first detected releasever=10 +and releasever_minor=0 when calling _setup_default_conf() via +dnf.Base(). But then _read_conf_file() called by dnf-automatic set +releasever again to 10, that rewrote releasever_minor to None and +then _read_conf_file() set releasever_minor to releasever_minor, i.e +to None. + +This patch does not change the code flow to minimize regressions. +Instead it saves the original releasever_minor value to be able to +default to it again. + +Resolve: #2259 +Resolve: https://issues.redhat.com/browse/RHEL-108617 +Signed-off-by: Petr Písař +--- + dnf/cli/cli.py | 8 ++++++-- + tests/test_config.py | 12 ++++++++++++ + 2 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py +index 0be9559d4..f1eef7a9a 100644 +--- a/dnf/cli/cli.py ++++ b/dnf/cli/cli.py +@@ -986,9 +986,13 @@ class Cli(object): + if arg is not None: + return arg + return None ++ # Setting conf.releasever rewrites conf.releasever_major and ++ # conf.releasever_minor. Copy them for later use. ++ old_releasever_major = conf.releasever_major ++ old_releasever_minor = conf.releasever_minor + conf.releasever = or_else(releasever, conf.releasever) +- conf.releasever_major = or_else(releasever_major, det_major, conf.releasever_major) +- conf.releasever_minor = or_else(releasever_minor, det_minor, conf.releasever_minor) ++ conf.releasever_major = or_else(releasever_major, det_major, old_releasever_major) ++ conf.releasever_minor = or_else(releasever_minor, det_minor, old_releasever_minor) + + if conf.releasever is None: + logger.warning(_("Unable to detect release version (use '--releasever' to specify " +diff --git a/tests/test_config.py b/tests/test_config.py +index 69ba988c4..9445ea29b 100644 +--- a/tests/test_config.py ++++ b/tests/test_config.py +@@ -21,6 +21,7 @@ from __future__ import unicode_literals + + import argparse + ++import dnf + import dnf.conf + import dnf.conf.read + import dnf.exceptions +@@ -164,3 +165,14 @@ class ConfTest(tests.support.TestCase): + self.assertEqual(conf.releasever, '1.2') + self.assertEqual(conf.releasever_major, '3') + self.assertEqual(conf.releasever_minor, '4') ++ ++ def test__read_conf_file_preserves_autodetected_releasever_major_minor(self): ++ base = dnf.Base() ++ base.conf.releasever = '1' # Do not set to '1.2', autodetection pretends '1' ++ base.conf.releasever_major = '1' ++ base.conf.releasever_minor = '2' ++ cli = dnf.cli.Cli(base) ++ cli._read_conf_file() ++ self.assertEqual(base.conf.releasever, '1') ++ self.assertEqual(base.conf.releasever_major, '1') ++ self.assertEqual(base.conf.releasever_minor, '2') +-- +2.50.1 + diff --git a/dnf.spec b/dnf.spec index 98ca279..548ac18 100644 --- a/dnf.spec +++ b/dnf.spec @@ -72,7 +72,7 @@ It supports RPMs, modules and comps groups & environments. Name: dnf Version: 4.20.0 -Release: 12%{?dist} +Release: 14%{?dist} Summary: %{pkg_summary} # For a breakdown of the licensing, see PACKAGE-LICENSING License: GPL-2.0-or-later AND GPL-1.0-only @@ -101,6 +101,9 @@ Patch20: 0020-Add-releasever-major-and-releasever-minor-options.patch Patch21: 0021-doc-Document-detect_releasevers-and-update-example.patch Patch22: 0022-tests-Patch-detect_releasevers-not-detect_releasever.patch Patch23: 0023-Document-how-releasever-releasever_-major-minor-affe.patch +Patch24: 0024-Add-deprecation-warning-for-module-commands.patch +Patch25: 0025-Add-modularity-deprecation-warning-to-doc-pages.patch +Patch26: 0026-automatic-Fix-detecting-releasever_minor.patch BuildArch: noarch BuildRequires: cmake @@ -456,6 +459,13 @@ popd # bootc subpackage does not include any files %changelog +* Wed Aug 13 2025 Petr Pisar - 4.20.0-14 +- Fix detecting releasever_minor in dnf-automatic (RHEL-108617) + +* Tue Aug 12 2025 Evan Goode - 4.20.0-13 +- Add deprecation warning to modularity commands/docs + Resolves: RHEL-104310 + * Fri Feb 07 2025 Carl George - 4.20.0-12 - Override releasever_{major,minor} with system-release provides (RHEL-68034)