[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

seth vidal skvidal at fedoraproject.org
Tue Jun 22 19:56:48 UTC 2010


On Tue, 2010-06-22 at 00:58 -0400, James Antill wrote:
> > -
> > +            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.

I'm not sure the context - but who knows - I guess the use case I was
thinking of was storing additional info on what's gone on in the
transaction or any dump of data out of one of our other resources. So
knowing the rpmdbv to go into the additional history seems less
important, you'll know the rpmdbv it's associated with b/c the history
db knows the rpmdbv and each additional_info is linked to the tid.


> > @@ -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?
> 

Yep - and fixed in both place - I putted the historyend plugin call
right BEFORE the history.end() call.

I'll send another patch in a sec.


-sv




More information about the Yum-devel mailing list