Revert Fix messages for starting and failing scriptlets

This commit is contained in:
t_feng 2020-02-24 10:58:35 +08:00
parent 602fef2cb2
commit a8419dfc43
2 changed files with 79 additions and 1 deletions

View File

@ -0,0 +1,73 @@
From 6ba90e26497b01a0913f9ec8e66c6bc9500133df Mon Sep 17 00:00:00 2001
From: fengtao <fengtao40@huawei.com>
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, "<unknown>")
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

View File

@ -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 <buildteam@openeuler.org> - 4.2.15-5
- Revert Fix messages for starting and failing scriptlets
* Fri Feb 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 4.2.15-4
- remove python2