[Yum-devel] [PATCH] - add historyend and historybegin plugin conduits - add history write_addon_data and an addon_data path so we can write out arbitrary data to a file stored per history file and per transaction id - add historypluginconduit which gives the user access to yumbase.history directly

James Antill james at fedoraproject.org
Tue Jun 22 04:58:56 UTC 2010


On Mon, 2010-06-21 at 17:39 -0400, Seth Vidal wrote:
> ---
>  yum/__init__.py |    5 +++--
>  yum/history.py  |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  yum/plugins.py  |    7 +++++++
>  3 files changed, 63 insertions(+), 3 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 4fbf342..6bcc666 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -1315,7 +1315,7 @@ class YumBase(depsolve.Depsolve):
>                  cmdline = ' '.join(self.cmds)
>              self.history.beg(rpmdbv, using_pkgs, list(self.tsInfo),
>                               self.skipped_packages, rpmdb_problems, cmdline)
> -
> +            self.plugins.run('historybegin')
>          #  Just before we update the transaction, update what we think the
>          # rpmdb will look like. This needs to be done before the run, so that if
>          # "something" happens and the rpmdb is different from what we think it

 I'd guess plugins would want to know the rpmdbv? Maybe not.

> @@ -1341,7 +1341,8 @@ class YumBase(depsolve.Depsolve):
>              if self.conf.history_record and not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST):
>                  herrors = [to_unicode(to_str(x)) for x in errors]
>                  self.history.end(rpmdbv, 2, errors=herrors)
> -            
> +                self.plugins.run('historyend')
> +                
>              self.logger.critical(_("Transaction couldn't start:"))
>              for e in errors:
>                  self.logger.critical(e[0]) # should this be 'to_unicoded'?

 I assume you want another one around 1475, for the
success .history.end()? Also the plugins probably want to know the
return code.
 And doing this after the .history.end() means that the tid has been
deleted (so addon won't work), so maybe do it just before that?



More information about the Yum-devel mailing list