[Yum-devel] [PATCH] Catch PackageSackError from warn checks, BZ 634595.
seth vidal
skvidal at fedoraproject.org
Wed Mar 9 21:56:22 UTC 2011
On Wed, 2011-03-09 at 10:21 -0500, James Antill wrote:
> ---
> 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)
ACK
-sv
More information about the Yum-devel
mailing list