From a8419dfc438368d74dc40a2040677142b443a2ec Mon Sep 17 00:00:00 2001 From: t_feng Date: Mon, 24 Feb 2020 10:58:35 +0800 Subject: [PATCH] Revert Fix messages for starting and failing scriptlets --- ...-for-starting-and-failing-scriptlets.patch | 73 +++++++++++++++++++ dnf.spec | 7 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 backport-Revert-Fix-messages-for-starting-and-failing-scriptlets.patch diff --git a/backport-Revert-Fix-messages-for-starting-and-failing-scriptlets.patch b/backport-Revert-Fix-messages-for-starting-and-failing-scriptlets.patch new file mode 100644 index 0000000..b6f8cd7 --- /dev/null +++ b/backport-Revert-Fix-messages-for-starting-and-failing-scriptlets.patch @@ -0,0 +1,73 @@ +From 6ba90e26497b01a0913f9ec8e66c6bc9500133df Mon Sep 17 00:00:00 2001 +From: fengtao +Date: Mon, 24 Feb 2020 10:07:51 +0800 +Subject: [PATCH] tmp fix + +--- + dnf/yum/rpmtrans.py | 35 +++++------------------------------ + 1 file changed, 5 insertions(+), 30 deletions(-) + +diff --git a/dnf/yum/rpmtrans.py b/dnf/yum/rpmtrans.py +index 58c6101..6033309 100644 +--- a/dnf/yum/rpmtrans.py ++++ b/dnf/yum/rpmtrans.py +@@ -391,21 +391,9 @@ class RPMTransaction(object): + scriptlet_name = rpm.tagnames.get(amount, "") + + transaction_list = self._extract_cbkey(key) +- pkg_currenly_being_handled = transaction_list[0].pkg ++ name = transaction_list[0].pkg.name + +- if hasattr(key, "name"): +- pkg_which_owns_this_scriptlet_name = key.name +- else: +- pkg_which_owns_this_scriptlet_name = key +- +- # In case rpm trigger runs scriptlet of some other package +- if pkg_which_owns_this_scriptlet_name != pkg_currenly_being_handled.name: +- msg = ("Error in %s scriptlet in rpm package %s triggered by rpm package %s" +- % (scriptlet_name, pkg_which_owns_this_scriptlet_name, +- pkg_currenly_being_handled)) +- else: +- msg = ("Error in %s scriptlet in rpm package %s" +- % (scriptlet_name, pkg_currenly_being_handled)) ++ msg = ("Error in %s scriptlet in rpm package %s" % (scriptlet_name, name)) + + for display in self.displays: + display.error(msg) +@@ -414,29 +402,16 @@ class RPMTransaction(object): + # TODO: this doesn't fit into libdnf TransactionItem use cases + action = dnf.transaction.PKG_SCRIPTLET + if key is None and self._te_list == []: +- pkg_currenly_being_handled = 'None' ++ pkg = 'None' + else: + transaction_list = self._extract_cbkey(key) +- pkg_currenly_being_handled = transaction_list[0].pkg ++ pkg = transaction_list[0].pkg + complete = self.complete_actions if self.total_actions != 0 and self.complete_actions != 0 \ + else 1 + total = self.total_actions if self.total_actions != 0 and self.complete_actions != 0 else 1 + +- if hasattr(key, "name"): +- pkg_which_owns_this_scriptlet_name = key.name +- else: +- pkg_which_owns_this_scriptlet_name = key +- +- # In case rpm trigger runs scriptlet of some other package +- if pkg_which_owns_this_scriptlet_name != pkg_currenly_being_handled.name: +- # Show only the pkg name, because we don't have the full nevra +- # and if we search for the pkg we could show misleding information +- pkg_or_key = pkg_which_owns_this_scriptlet_name +- else: +- pkg_or_key = pkg_currenly_being_handled +- + for display in self.displays: +- display.progress(pkg_or_key, action, 100, 100, complete, total) ++ display.progress(pkg, action, 100, 100, complete, total) + + def _scriptStop(self): + self._scriptout() +-- +1.8.3.1 + diff --git a/dnf.spec b/dnf.spec index 49e2f87..fe913c6 100644 --- a/dnf.spec +++ b/dnf.spec @@ -6,7 +6,7 @@ Name: dnf Version: 4.2.15 -Release: 4 +Release: 5 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 @@ -14,6 +14,8 @@ Source0: https://github.com/rpm-software-management/dnf/archive/%{v Patch9000: Bugfix-format-problem.patch +Patch6000: backport-Revert-Fix-messages-for-starting-and-failing-scriptlets.patch + BuildArch: noarch BuildRequires: cmake gettext systemd bash-completion %{_bindir}/sphinx-build-3 Requires: python3-%{name} = %{version}-%{release} libreport-filesystem @@ -201,6 +203,9 @@ ln -sr %{buildroot}%{_sysconfdir}/%{name}/vars %{buildroot}%{_sysconfdir}/yum/v %{_mandir}/man8/%{name}-automatic.8* %changelog +* Mon Feb 24 2020 openEuler Buildteam - 4.2.15-5 +- Revert Fix messages for starting and failing scriptlets + * Fri Feb 14 2020 openEuler Buildteam - 4.2.15-4 - remove python2