Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-10-16 20:28:25 -0400
committerAllan McRae <allan@archlinux.org>2015-10-18 10:59:23 +1000
commit16718a216ee5607c56d220a198fdb48a923aaafc (patch)
tree029cbd2d0bbae31ad48e9b412a7b18f2c414ceac /lib/libalpm/trans.c
parent568a89d58018e89e3a5bb3c28cb0ca3b845aae1b (diff)
run hooks during trans_commit
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c6
1 files changed, 6 insertions, 0 deletions
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;