Compare commits

..

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

55 changed files with 167 additions and 38 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/dnf-4.7.0.tar.gz SOURCES/dnf-4.7.0.tar.gz
/dnf-4.7.0.tar.gz

View File

@ -0,0 +1,36 @@
From a1feaf8c26433325dd939a4bb0c47b50b44cfe2d Mon Sep 17 00:00:00 2001
From: Evan Goode <mail@evangoo.de>
Date: Mon, 13 Mar 2023 14:50:41 -0400
Subject: [PATCH 48/49] smtplib: catch OSError, not SMTPException
Upstream commit: aab7defca4fd827ede02336e5a0cf95e8691fb74
Some, but not all, types of connection error are caught by smtplib and
reraised as an smtplib.SMTPException. Notably, TimeoutError,
socket.gaierror (name resolution failure), and ConnectionRefusedError
and are not caught.
The more generic OSError should be caught here instead.
Resolves #1905
Resolves: https://issues.redhat.com/browse/RHEL-46030
---
dnf/automatic/emitter.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/automatic/emitter.py b/dnf/automatic/emitter.py
index 4aea4b02..648f1a1d 100644
--- a/dnf/automatic/emitter.py
+++ b/dnf/automatic/emitter.py
@@ -106,7 +106,7 @@ class EmailEmitter(Emitter):
smtp = smtplib.SMTP(self._conf.email_host, timeout=300)
smtp.sendmail(email_from, email_to, message.as_string())
smtp.close()
- except smtplib.SMTPException as exc:
+ except OSError as exc:
msg = _("Failed to send an email via '%s': %s") % (
self._conf.email_host, exc)
logger.error(msg)
--
2.48.1

View File

@ -0,0 +1,87 @@
From 201675a56b89d6f3543ce5d734deebe6c4d9049f Mon Sep 17 00:00:00 2001
From: Marek Blaha <mblaha@redhat.com>
Date: Thu, 17 Oct 2024 13:30:21 +0200
Subject: [PATCH 49/49] automatic: Check availability of config file
If a configuration file is explicitly specified on the command line,
ensure that it exists and is readable. If the file is not found, notify
the user immediately and terminate the process.
This resolves issues where users may run dnf-automatic with unrecognized
positional arguments, such as `dnf-automatic install`.
The most natural approach to handle a non-existing config file would be
by catching the exception thrown by the `read()` method of the
`libdnf.conf.ConfigParser` class. Unfortunately, the Python bindings
override the `read()` method at the SWIG level, causing it to suppress any
potentially raised IOError.
For details see this section of the commit
https://github.com/rpm-software-management/libdnf/commit/8f1fedf8551b72d6bc24018f5980714b3a103aeb
def ConfigParser__newRead(self, filenames):
parsedFNames = []
try:
if isinstance(filenames, str) or isinstance(filenames, unicode):
filenames = [filenames]
except NameError:
pass
for fname in filenames:
try:
self.readFileName(fname)
parsedFNames.append(fname)
except IOError:
pass
except Exception as e:
raise RuntimeError("Parsing file '%s' failed: %s" % (fname, str(e)))
return parsedFNames
ConfigParser.read = ConfigParser__newRead
Resolves: https://issues.redhat.com/browse/RHEL-46030
---
dnf/automatic/main.py | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
index ccd9ab64..3d73ffce 100644
--- a/dnf/automatic/main.py
+++ b/dnf/automatic/main.py
@@ -73,7 +73,7 @@ def build_emitters(conf):
def parse_arguments(args):
parser = argparse.ArgumentParser()
- parser.add_argument('conf_path', nargs='?', default=dnf.const.CONF_AUTOMATIC_FILENAME)
+ parser.add_argument('conf_path', nargs='?')
parser.add_argument('--timer', action='store_true')
parser.add_argument('--installupdates', dest='installupdates', action='store_true')
parser.add_argument('--downloadupdates', dest='downloadupdates', action='store_true')
@@ -88,7 +88,17 @@ def parse_arguments(args):
class AutomaticConfig(object):
def __init__(self, filename=None, downloadupdates=None,
installupdates=None):
- if not filename:
+ if filename:
+ # Specific config file was explicitely requested. Check that it exists
+ # and is readable.
+ if os.access(filename, os.F_OK):
+ if not os.access(filename, os.R_OK):
+ raise dnf.exceptions.Error(
+ "Configuration file \"{}\" is not readable.".format(filename))
+ else:
+ raise dnf.exceptions.Error(
+ "Configuration file \"{}\" not found.".format(filename))
+ else:
filename = dnf.const.CONF_AUTOMATIC_FILENAME
self.commands = CommandsConfig()
self.email = EmailConfig()
@@ -295,6 +305,8 @@ def wait_for_network(repos, timeout):
def main(args):
(opts, parser) = parse_arguments(args)
+ conf = None
+ emitters = None
try:
conf = AutomaticConfig(opts.conf_path, opts.downloadupdates,
--
2.48.1

View File

@ -0,0 +1,25 @@
From 75c59dcb38d5672ffcfea9bb4cc999ab30294fe9 Mon Sep 17 00:00:00 2001
From: Marek Blaha <mblaha@redhat.com>
Date: Wed, 29 Jan 2025 13:29:34 +0100
Subject: [PATCH] Fix missing import in automatic
Fixes omitted `import os` in previous commit.
---
dnf/automatic/main.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
index 3d73ffce..9d680e9e 100644
--- a/dnf/automatic/main.py
+++ b/dnf/automatic/main.py
@@ -24,6 +24,7 @@ from __future__ import unicode_literals
import argparse
import logging
+import os
import random
import socket
import time
--
2.48.1

View File

@ -1,32 +0,0 @@
diff -aruN dnf-4.7.0/dnf/const.py.in dnf-4.7.0_alma/dnf/const.py.in
--- dnf-4.7.0/dnf/const.py.in 2021-04-12 18:26:33.000000000 +0300
+++ dnf-4.7.0_alma/dnf/const.py.in 2021-12-30 10:30:33.806575400 +0300
@@ -55,4 +55,4 @@
USER_AGENT = "dnf/%s" % VERSION
BUGTRACKER_COMPONENT=NAME.lower()
-BUGTRACKER='https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%s' % BUGTRACKER_COMPONENT
+BUGTRACKER='https://bugs.almalinux.org/'
diff -aruN dnf-4.7.0/doc/conf.py.in dnf-4.7.0_alma/doc/conf.py.in
--- dnf-4.7.0/doc/conf.py.in 2021-04-12 18:26:33.000000000 +0300
+++ dnf-4.7.0_alma/doc/conf.py.in 2021-12-30 10:34:07.810855800 +0300
@@ -267,5 +267,5 @@
.. _DNF: https://github.com/rpm-software-management/dnf/
.. _hawkey: http://rpm-software-management.github.io/hawkey/
.. _YUM: http://yum.baseurl.org/
-.. _bugzilla: https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dnf
+.. _bugzilla: https://bugs.almalinux.org/
"""
diff -aruN dnf-4.7.0/tests/test_config.py dnf-4.7.0_alma/tests/test_config.py
--- dnf-4.7.0/tests/test_config.py 2021-04-12 18:26:33.000000000 +0300
+++ dnf-4.7.0_alma/tests/test_config.py 2021-12-30 10:33:24.147815500 +0300
@@ -55,8 +55,7 @@
def test_bugtracker(self):
conf = Conf()
self.assertEqual(conf.bugtracker_url,
- "https://bugzilla.redhat.com/enter_bug.cgi" +
- "?product=Fedora&component=dnf")
+ "https://bugs.almalinux.org/")
def test_conf_from_file(self):
conf = Conf()

View File

@ -66,7 +66,7 @@ It supports RPMs, modules and comps groups & environments.
Name: dnf Name: dnf
Version: 4.7.0 Version: 4.7.0
Release: 20%{?dist}.alma Release: 21%{?dist}
Summary: %{pkg_summary} Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING # For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ License: GPLv2+
@ -123,11 +123,11 @@ Patch0044: 0044-Document-symbols-in-dnf-history-list-output.patch
Patch0045: 0045-RHEL-1245-Remove-usrbin-from-syspath-noimpor-garbage.patch Patch0045: 0045-RHEL-1245-Remove-usrbin-from-syspath-noimpor-garbage.patch
Patch0046: 0046-RHEL-6393-Fix-japanese-translations.patch Patch0046: 0046-RHEL-6393-Fix-japanese-translations.patch
Patch0047: 0047-RHEL-11786-Fix-substitution-in-kvp-in-add_new_repo.patch Patch0047: 0047-RHEL-11786-Fix-substitution-in-kvp-in-add_new_repo.patch
Patch0048: 0048-smtplib-catch-OSError-not-SMTPException.patch
Patch0049: 0049-automatic-Check-availability-of-config-file.patch
Patch0050: 0050-Fix-missing-import-in-automatic.patch
#Almalinux patches
Patch10000: almalinux_bugtracker.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gettext BuildRequires: gettext
@ -426,15 +426,18 @@ popd
%{python3_sitelib}/%{name}/automatic/ %{python3_sitelib}/%{name}/automatic/
%changelog %changelog
* Wed Mar 27 2024 Eduard Abdullin <eabdullin@almalinux.org> - 4.7.0-20.alma * Wed Jan 29 2025 Marek Blaha <mblaha@redhat.com> - 4.7.0-21
- AlmaLinux changes - automatic: catch OSError, not SMTPException on smtp errors (RHEL-71545)
- automatic: Check availability of config file (RHEL-71545)
* Mon Oct 16 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-20 * Mon Oct 16 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-20
- Remove /usr/bin from sys.path to avoid accidentally importing garbage (RHEL-1245) - Remove /usr/bin from sys.path to avoid accidentally importing garbage (RHEL-1245)
- Fix japanese translations (RHEL-6393) - Fix japanese translations (RHEL-6393)
- Fix substitution in kay-value-pair list in add_new_repo (RHEL-11786) - Fix substitution in kay-value-pair list in add_new_repo (RHEL-11786)
* Wed Jun 28 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-19 * Wed Jun 28 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-19
- Document symbols in `dnf history list` output (RhBug:2172067) - Document symbols in `dnf history list` output (RhBug:2172067)
* Wed May 31 2023 Nicola Sella <nsella@redhat.com> - 4.7.0-18 * Wed May 31 2023 Nicola Sella <nsella@redhat.com> - 4.7.0-18
- Return an error when transaction fails (RhBug:2170093) - Return an error when transaction fails (RhBug:2170093)
@ -448,6 +451,7 @@ popd
* Thu Jan 05 2023 Nicola Sella <nsella@redhat.com> - 4.7.0-15 * Thu Jan 05 2023 Nicola Sella <nsella@redhat.com> - 4.7.0-15
- Ignore processing variable files with unsupported encoding (RhBug:2141215) - Ignore processing variable files with unsupported encoding (RhBug:2141215)
- Better explain traceback of rpm.error with dnf - Better explain traceback of rpm.error with dnf
* Wed Nov 30 2022 Nicola Sella <nsella@redhat.com> - 4.7.0-14 * Wed Nov 30 2022 Nicola Sella <nsella@redhat.com> - 4.7.0-14
- Document changes to offline-upgrade command (RhBug:1939975,2139324) - Document changes to offline-upgrade command (RhBug:1939975,2139324)

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.ci-dnf-stack-gating.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (dnf-4.7.0.tar.gz) = 40bb6371986314ac1e6ef3eb2896a43cab560da850b3ecb37c9cf84143ff8ec6c6f1ee94f1d2bddd31d5399d5672f22828c678c766107d9ab3fd18e2f07232fa