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

Panu Matilainen pmatilai at laiskiainen.org
Fri Sep 23 07:03:48 UTC 2016


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.

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.

...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.

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
>



More information about the Rpm-maint mailing list