From 7b1f04933bc1272e8af9d5cd58787c7362aaa9f5 Mon Sep 17 00:00:00 2001 From: liyue01 Date: Mon, 29 Jul 2024 16:17:55 +0800 Subject: [PATCH] Fix unload plugins behavior without filelists --- dnf.spec | 6 +++- ...d-plugins-behavior-without-filelists.patch | 33 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 fix-unload-plugins-behavior-without-filelists.patch diff --git a/dnf.spec b/dnf.spec index 3a5a264..f5befd2 100644 --- a/dnf.spec +++ b/dnf.spec @@ -3,7 +3,7 @@ Name: dnf Version: 4.16.2 -Release: 5 +Release: 6 Summary: A software package manager that manages packages on Linux distributions. License: GPL-2.0-or-later AND GPL-1.0-only URL: https://github.com/rpm-software-management/dnf @@ -31,6 +31,7 @@ Patch6005: backport-Add-all-candidates-for-reinstall-to-solver.patch Patch6006: backport-Limit-queries-to-nevra-forms-when-provided-by-command.patch Patch6007: backport-doc-Remove-provide-of-spec-definition-for-repoquery-command.patch Patch6008: backport-Update-the-man-page-entry-for-the-countme-option.patch +Patch6009: fix-unload-plugins-behavior-without-filelists.patch BuildArch: noarch BuildRequires: cmake gettext systemd bash-completion python3-sphinx @@ -258,6 +259,9 @@ popd %{_mandir}/man8/%{name}-automatic.8* %changelog +* Mon Jul 29 2024 liyue01 - 4.16.2-6 +- Fix unload plugins behavior without filelists + * Thu Jul 25 2024 LuWu <2398491106@qq.com> - 4.16.2-5 - Limit queries to nevra forms when provided by command and Update the man page entry for the countme option diff --git a/fix-unload-plugins-behavior-without-filelists.patch b/fix-unload-plugins-behavior-without-filelists.patch new file mode 100644 index 0000000..c76e3a9 --- /dev/null +++ b/fix-unload-plugins-behavior-without-filelists.patch @@ -0,0 +1,33 @@ +From 73a42eaadc292918a6e2b692d46e78dfa6571a29 Mon Sep 17 00:00:00 2001 +From: liyue01 +Date: Mon, 29 Jul 2024 16:07:40 +0800 +Subject: [PATCH] Fix unload plugins behavior without filelists + +--- + dnf/plugin.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dnf/plugin.py b/dnf/plugin.py +index d2f46ce..6ab71c2 100644 +--- a/dnf/plugin.py ++++ b/dnf/plugin.py +@@ -29,6 +29,7 @@ import inspect + import logging + import operator + import os ++import rpm + import sys + import traceback + +@@ -193,7 +194,7 @@ class Plugins(object): + + # check whether removed plugin file is added at the same time (upgrade of a plugin) + for pkg in transaction.install_set: +- erased_plugin_files.difference_update(pkg.files) ++ erased_plugin_files.difference_update(pkg._header[rpm.RPMTAG_FILENAMES]) + + # unload plugins that were removed in transaction + for plugin_file in erased_plugin_files: +-- +2.27.0 + -- Gitee