Skip to content

Commit a28a68c

Browse files
mlusconrh-atomic-bot
authored andcommitted
rpmtrans: log currently processing package from rpm (RhBug:1305232)
Requires rpm-software-management/rpm@124ed29. References: https://bugzilla.redhat.com/show_bug.cgi?id=1305232 Signed-off-by: Igor Gnatenko <[email protected]> Closes: rpm-software-management#857 Approved by: j-mracek
1 parent aa87217 commit a28a68c

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

dnf.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%global hawkey_version 0.12.1
22
%global librepo_version 1.7.19
33
%global libcomps_version 0.1.8
4-
%global rpm_version 4.13.0-0.rc1.29
4+
%global rpm_version 4.14.0
55
%global min_plugins_core 2.1.3
66
%global dnf_langpacks_ver 0.15.1-6
77

dnf/yum/rpmtrans.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,21 @@ def error(self, message):
148148
def filelog(self, package, action):
149149
# If the action is not in the fileaction list then dump it as a string
150150
# hurky but, sadly, not much else
151-
process = self.fileaction[action]
152-
if process is None:
153-
return
154-
msg = '%s: %s' % (process, package)
151+
if not dnf.util.is_string_type(action):
152+
action = self.fileaction[action]
153+
if action is None:
154+
return
155+
msg = '%s: %s' % (action, package)
155156
self.rpm_logger.info(msg)
156157

157158
class RPMTransaction(object):
158159
def __init__(self, base, test=False, displays=()):
160+
self.ts_action = {TransactionDisplay.PKG_DOWNGRADE: 'Downgrading',
161+
TransactionDisplay.PKG_ERASE: 'Erasing',
162+
TransactionDisplay.PKG_INSTALL: 'Installing',
163+
TransactionDisplay.PKG_REINSTALL: 'Reinstalling',
164+
TransactionDisplay.PKG_UPGRADE: 'Upgrading'}
165+
159166
if not displays:
160167
displays = [ErrorTransactionDisplay()]
161168
self.displays = displays
@@ -263,7 +270,7 @@ def callback(self, what, amount, total, key, client_data):
263270
# This callback type is issued every time the next transaction
264271
# element is about to be processed by RPM, before any other
265272
# callbacks are issued. "amount" carries the index of the element.
266-
self._elemProgress(amount)
273+
self._elemProgress(key, amount)
267274
elif what == rpm.RPMCALLBACK_INST_OPEN_FILE:
268275
return self._instOpenFile(key)
269276
elif what == rpm.RPMCALLBACK_INST_CLOSE_FILE:
@@ -302,9 +309,14 @@ def _trans_progress(self, amount, total):
302309
for display in self.displays:
303310
display.progress('', action, amount + 1, total, 1, 1)
304311

305-
def _elemProgress(self, index):
312+
def _elemProgress(self, key, index):
306313
self._te_index = index
307314
self.complete_actions += 1
315+
if not self.test:
316+
pkg, state, tsi = self._extract_cbkey(key)
317+
action = TransactionDisplay.ACTION_FROM_OP_TYPE[tsi.op_type]
318+
for display in self.displays:
319+
display.filelog(pkg, self.ts_action[action])
308320

309321
def _instOpenFile(self, key):
310322
self.lastmsg = None

0 commit comments

Comments
 (0)