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:
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;