[Rpm-maint] [PATCH v2 3/4] rpmplugins: Introduce new fsm_pre and fsm_post hooks

Stefan Berger stefanb at us.ibm.com
Fri Sep 23 11:12:31 UTC 2016


Panu Matilainen <pmatilai at laiskiainen.org> wrote on 09/23/2016 03:03:48 
AM:

> From: Panu Matilainen <pmatilai at laiskiainen.org>
> To: Stefan Berger <stefanb at linux.vnet.ibm.com>, rpm-maint at lists.rpm.org
> Cc: Stefan Berger/Watson/IBM at IBMUS, fionnuala.gunter at gmail.com
> Date: 09/23/2016 03:03 AM
> Subject: Re: [Rpm-maint] [PATCH v2 3/4] rpmplugins: Introduce new 
> fsm_pre and fsm_post hooks
> 
> On 09/22/2016 08:30 PM, Stefan Berger wrote:
> > Introduce fsm_pre and fsm_post hooks, which are invoked
> > before and after the package files are installed.
> >
> > Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
> [...]
> > diff --git a/lib/rpmplugins.h b/lib/rpmplugins.h
> > index 39762c3..3702526 100644
> > --- a/lib/rpmplugins.h
> > +++ b/lib/rpmplugins.h
> > @@ -167,6 +167,25 @@ rpmRC rpmpluginsCallFsmFilePrepare(rpmPlugins
> plugins, rpmfi fi,
> >                                     const char *path, const char 
*dest,
> >                                     mode_t mode, rpmFsmOp op);
> >
> > +/** \ingroup rpmplugins
> > + * Call the fsm pre plugin hook.
> > + * @param plugins   plugins structure
> > + * @param te      processed transaction element
> > + * @return      RPMRC_OK on success, RPMRC_FAIL otherwise
> > + */
> > +RPM_GNUC_INTERNAL
> > +rpmRC rpmpluginsCallFsmPre(rpmPlugins plugins, rpmte te);
> > +
> > +/** \ingroup rpmplugins
> > + * Call the fsm post plugin hook.
> > + * @param plugins   plugins structure
> > + * @param te      processed transaction element
> > + * @param res      fsm result code
> > + * @return      RPMRC_OK on success, RPMRC_FAIL otherwise
> > + */
> > +RPM_GNUC_INTERNAL
> > +rpmRC rpmpluginsCallFsmPost(rpmPlugins plugins, rpmte te, int rc);
> > +
> 
> Any particular reason not to pass the associated rpmfiles to these hooks 

> too? That would be the main object of these hooks, regardless of what 
> your particular needs in this case are.

I only passed the parameters that I actually need. I can add the files to 
that as well, if other plugins may require them.

> 
> Or actually to really follow the generic style of the plugin interface, 
> you'd *only* pass the files "object" and not the transaction element, 
> you can get and store that from PsmPre already.

PsmPre also passes the rpmte. PsmPre run after the post install scriptlet 
runs, so therefore we cannot use it.

> 
> ...or alternatively you could install the signatures from one of the 
> FsmFile hooks where the file-level action is available, then you dont 
> need access to the transaction element. And actually it'd probably be 
> more correct too because files can get skipped for various reasons, in 
> which case you should not add the signature either.

Good, I'll try to move it there...

   Stefan

> 
> So technically none of this is actually needed. Unless I'm missing 
> something, I'm not at all familiar with IMA really.
> 
>    - Panu -
> 
> 
> 
>    - Panu -
> 
> >  #ifdef __cplusplus
> >  }
> >  #endif
> >
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20160923/758a3ad3/attachment.html>


More information about the Rpm-maint mailing list