[yum-commits] yum/rpmtrans.py
James Antill
james at osuosl.org
Tue Aug 14 19:25:50 UTC 2012
yum/rpmtrans.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
commit b4195162200bc0fa918c25b75073e569dc9ddfa6
Author: Panu Matilainen <pmatilai at laiskiainen.org>
Date: Mon Aug 13 12:06:22 2012 +0300
Minimally teach yum about rpm >= 4.10 scriptlet start and stop callbacks
Rpm >= 4.10 issues callbacks on all scriptlet start and stop events.
This would allow more precise logging by script type etc, but
compatibility would get more complicated. For now, just make sure all
scriptlet output gets actually logged. BZ 615763.
diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py
index 24a1f9e..61c9a0e 100644
--- a/yum/rpmtrans.py
+++ b/yum/rpmtrans.py
@@ -475,6 +475,11 @@ class RPMTransaction:
# SCRIPT_ERROR is only in rpm >= 4.6.0
elif hasattr(rpm, "RPMCALLBACK_SCRIPT_ERROR") and what == rpm.RPMCALLBACK_SCRIPT_ERROR:
self._scriptError(bytes, total, h)
+ # SCRIPT_START and SCRIPT_STOP are only in rpm >= 4.10
+ elif hasattr(rpm, "RPMCALLBACK_SCRIPT_START") and what == rpm.RPMCALLBACK_SCRIPT_START:
+ self._scriptStart(bytes, total, h);
+ elif hasattr(rpm, "RPMCALLBACK_SCRIPT_STOP") and what == rpm.RPMCALLBACK_SCRIPT_STOP:
+ self._scriptStop(bytes, total, h);
def _transStart(self, bytes, total, h):
@@ -633,6 +638,13 @@ class RPMTransaction:
self.display.errorlog(msg)
# FIXME - what else should we do here? raise a failure and abort?
+ def _scriptStart(self, bytes, total, h):
+ pass
+
+ def _scriptStop(self, bytes, total, h):
+ name, txmbr = self._getTxmbr(h)
+ self._scriptout(txmbr or name)
+
def verify_txmbr(self, txmbr, count):
" Callback for post transaction when we are in verifyTransaction(). "
if not hasattr(self.display, 'verify_txmbr'):
More information about the Yum-commits
mailing list