From 16718a216ee5607c56d220a198fdb48a923aaafc Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 16 Oct 2015 20:28:25 -0400 Subject: run hooks during trans_commit Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/trans.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index ed073c09..a6b1aef6 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -40,6 +40,7 @@ #include "sync.h" #include "alpm.h" #include "deps.h" +#include "hook.h" /** \addtogroup alpm_trans Transaction Functions * @brief Functions to manipulate libalpm transactions @@ -189,6 +190,10 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) } } + if(_alpm_hook_run(handle, ALPM_HOOK_PRE_TRANSACTION) != 0) { + RET_ERR(handle, ALPM_ERR_TRANS_HOOK_FAILED, -1); + } + trans->state = STATE_COMMITING; alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction started\n"); @@ -215,6 +220,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction interrupted\n"); } else { alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction completed\n"); + _alpm_hook_run(handle, ALPM_HOOK_POST_TRANSACTION); } trans->state = STATE_COMMITED; -- cgit v1.2.3-24-g4f1b