@@ -148,14 +148,21 @@ def error(self, message):
148
148
def filelog (self , package , action ):
149
149
# If the action is not in the fileaction list then dump it as a string
150
150
# 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 )
155
156
self .rpm_logger .info (msg )
156
157
157
158
class RPMTransaction (object ):
158
159
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
+
159
166
if not displays :
160
167
displays = [ErrorTransactionDisplay ()]
161
168
self .displays = displays
@@ -263,7 +270,7 @@ def callback(self, what, amount, total, key, client_data):
263
270
# This callback type is issued every time the next transaction
264
271
# element is about to be processed by RPM, before any other
265
272
# callbacks are issued. "amount" carries the index of the element.
266
- self ._elemProgress (amount )
273
+ self ._elemProgress (key , amount )
267
274
elif what == rpm .RPMCALLBACK_INST_OPEN_FILE :
268
275
return self ._instOpenFile (key )
269
276
elif what == rpm .RPMCALLBACK_INST_CLOSE_FILE :
@@ -302,9 +309,14 @@ def _trans_progress(self, amount, total):
302
309
for display in self .displays :
303
310
display .progress ('' , action , amount + 1 , total , 1 , 1 )
304
311
305
- def _elemProgress (self , index ):
312
+ def _elemProgress (self , key , index ):
306
313
self ._te_index = index
307
314
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 ])
308
320
309
321
def _instOpenFile (self , key ):
310
322
self .lastmsg = None
0 commit comments