From 9633cbadee1f125f6e03bf8fa42cfe191d52f28a Mon Sep 17 00:00:00 2001 From: chenhaxing Date: Mon, 13 Mar 2023 20:30:55 +0800 Subject: [PATCH] dnf:fix AttributeError when io busy and press ctrl c --- ...eError-when-IO-busy-and-press-ctrl-c.patch | 29 +++++++++++++++++++ dnf.spec | 8 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 backport-fix-AttributeError-when-IO-busy-and-press-ctrl-c.patch diff --git a/backport-fix-AttributeError-when-IO-busy-and-press-ctrl-c.patch b/backport-fix-AttributeError-when-IO-busy-and-press-ctrl-c.patch new file mode 100644 index 0000000..d9ee612 --- /dev/null +++ b/backport-fix-AttributeError-when-IO-busy-and-press-ctrl-c.patch @@ -0,0 +1,29 @@ +From 759e7a5586f279efd41b65b2f84e0dd3bcf77fbd Mon Sep 17 00:00:00 2001 +From: chenhaixing123 +Date: Wed, 22 Feb 2023 17:27:04 +0800 +Subject: [PATCH] fix AttributeError when IO busy and press ctrl c + +Conflict:The content of "index" and "@@" are adapted +Reference:https://github.com/rpm-software-management/dnf/pull/1899/commits/759e7a5586f279efd41b65b2f84e0dd3bcf77fbd +--- + dnf/conf/config.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/dnf/conf/config.py b/dnf/conf/config.py +index 32516d1..e08ca72 100644 +--- a/dnf/conf/config.py ++++ b/dnf/conf/config.py +@@ -251,8 +251,9 @@ class MainConf(BaseConfig): + self.tempfiles = [] + + def __del__(self): +- for file_name in self.tempfiles: +- os.unlink(file_name) ++ if hasattr(self, 'tempfiles'): ++ for file_name in self.tempfiles: ++ os.unlink(file_name) + + @property + def get_reposdir(self): +-- +2.27.0 \ No newline at end of file diff --git a/dnf.spec b/dnf.spec index 27e1a01..939459f 100644 --- a/dnf.spec +++ b/dnf.spec @@ -3,7 +3,7 @@ Name: dnf Version: 4.14.0 -Release: 12 +Release: 13 Summary: A software package manager that manages packages on Linux distributions. License: GPLv2+ and GPLv2 and GPL URL: https://github.com/rpm-software-management/dnf @@ -30,6 +30,7 @@ Patch6002: backport-fix-plugins-unit-tests-unload-plugins-upon-their- Patch6003: backport-pass-whole-url-in-relativeUrl-to-packageTarget-for-rpm-url-download.patch Patch6004: backport-add-support-for-rollback-of-group-upgrade-rollback.patch Patch6005: backport-ignore-processing-variable-files-with-unsupported-encoding.patch +Patch6006: backport-fix-AttributeError-when-IO-busy-and-press-ctrl-c.patch BuildArch: noarch BuildRequires: cmake gettext systemd bash-completion python3-sphinx @@ -254,6 +255,11 @@ popd %{_mandir}/man8/%{name}-automatic.8* %changelog +* Mon Mar 13 2023 chenhaixing 4.14.0-13 +- CVE:NA +- SUG:NA +- DESC:dnf:fix AttributeError when io busy and press ctrl c + * Tue Mar 7 2023 chenhaixing 4.14.0-12 - CVE:NA - SUG:NA