[Yum-devel] [PATCH 3/3] Fully drop the rpmdb cache if the transaction failed, or was a test.
James Antill
james at and.org
Tue Jan 25 15:43:54 UTC 2011
---
yum/__init__.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/yum/__init__.py b/yum/__init__.py
index 2d9385e..f6c8403 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1486,7 +1486,12 @@ class YumBase(depsolve.Depsolve):
# drop out the rpm cache so we don't step on bad hdr indexes
- self.rpmdb.dropCachedDataPostTransaction(list(self.tsInfo))
+ if (self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST) or
+ resultobject.return_code):
+ self.rpmdb.dropCachedData()
+ else:
+ self.rpmdb.dropCachedDataPostTransaction(list(self.tsInfo))
+
self.plugins.run('posttrans')
# sync up what just happened versus what is in the rpmdb
if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST):
--
1.7.3.4
More information about the Yum-devel
mailing list