[Yum-devel] [PATCH 2/2] Fix return values from sync_anydb_key()
tim.lauridsen at gmail.com
tim.lauridsen at gmail.com
Sat Aug 20 14:54:17 UTC 2011
On Fri, Aug 19, 2011 at 8:01 PM, James Antill <james at and.org> wrote:
> ---
> yum/history.py | 8 ++++++--
> yumcommands.py | 6 ++++--
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/yum/history.py b/yum/history.py
> index 6449708..a9b12cf 100644
> --- a/yum/history.py
> +++ b/yum/history.py
> @@ -1313,7 +1313,9 @@ class YumHistory:
> val = getattr(ipkg, attr, None)
> if val is None:
> continue
> - self._save_anydb_key(ipkg, "rpm", attr, val)
> + if not self._save_anydb_key(ipkg, "rpm", attr, val):
> + return False
> + return True
>
> def _save_yumdb(self, ipkg):
> """ Save all the data for yumdb for this installed pkg, assumes
> @@ -1322,7 +1324,9 @@ class YumHistory:
> val = ipkg.yumdb_info.get(attr)
> if val is None:
> continue
> - self._save_anydb_key(ipkg, "yum", attr, val)
> + if not self._save_anydb_key(ipkg, "yum", attr, val):
> + return False
> + return True
>
> def _wipe_anydb(self, pkg, db):
> """ Delete all the data for rpmdb/yumdb for this installed pkg. """
> diff --git a/yumcommands.py b/yumcommands.py
> index 2d0fbfc..f7c6d4f 100644
> --- a/yumcommands.py
> +++ b/yumcommands.py
> @@ -2513,8 +2513,10 @@ class HistoryCommand(YumCommand):
> continue
>
> print "Syncing rpm/yum DB data for:", ipkg, "...",
> - base.history.sync_alldb(ipkg)
> - print "Done."
> + if base.history.sync_alldb(ipkg):
> + print "Done."
> + else:
> + print "FAILED."
>
> def doCheck(self, base, basecmd, extcmds):
> """Verify that conditions are met so that this command can
> --
> 1.7.6
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>
ACK
More information about the Yum-devel
mailing list