---
 yummain.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/yummain.py b/yummain.py
index 32c65aa..b4d90e4 100755
--- a/yummain.py
+++ b/yummain.py
@@ -76,6 +76,15 @@ def main(args):
             return 200
         return 0
 
+    def rpmdb_warn_checks():
+        try:
+            probs = base._rpmdb_warn_checks(out=verbose_logger.info, 
warn=False)
+        except YumBaseError, e:
+            # This is mainly for PackageSackError from rpmdb.
+            verbose_logger.info(_(" Yum checks failed: %s"), exception2msg(e))
+            probs = []
+        if not probs:
+            verbose_logger.info(_(" You could try running: rpm -Va --nofiles 
--nodigest"))
 
     logger = logging.getLogger("yum.main")
     verbose_logger = logging.getLogger("yum.verbose.main")
@@ -182,8 +191,7 @@ def main(args):
             logger.critical(prefix, msg.replace('\n', '\n' + prefix2nd))
         if not base.conf.skip_broken:
             verbose_logger.info(_(" You could try using --skip-broken to work 
around the problem"))
-        if not base._rpmdb_warn_checks(out=verbose_logger.info, warn=False):
-            verbose_logger.info(_(" You could try running: rpm -Va --nofiles 
--nodigest"))
+        warn_checks()
         if unlock(): return 200
         return 1
     elif result == 2:
@@ -215,8 +223,7 @@ def main(args):
         (result, resultmsgs) = return_code
         for msg in resultmsgs:
             logger.critical("%s", msg)
-        if not base._rpmdb_warn_checks(out=verbose_logger.info, warn=False):
-            verbose_logger.info(_(" You could try running: rpm -Va --nofiles 
--nodigest"))
+        warn_checks()
         return_code = result
         if base._ts_save_file:
             verbose_logger.info(_("Your transaction was saved, rerun it with: 
yum load-transaction %s") % base._ts_save_file)
-- 
1.7.3.4

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to