diff options
author | Allan McRae <allan@archlinux.org> | 2015-12-14 13:39:58 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2015-12-15 15:12:32 +1000 |
commit | 8d3bd4ec13940da70f946e6e63d59a05c89cbb50 (patch) | |
tree | fe1d4e60c27d4f2797b1517aae8f88c722339d33 /lib/libalpm/trans.c | |
parent | 132ec4c3b9f761fb76ff9cf567f3723db62d72df (diff) | |
download | pacman-8d3bd4ec13940da70f946e6e63d59a05c89cbb50.tar.xz |
Add ALPM_EVENT_TRANSACTION_{START,DONE} events
This provides a way to detect when the processing of package changes starts,
allowing pacman to delineate hook output and package installation/removal
output.
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r-- | lib/libalpm/trans.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 06997a09..5b52049d 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -160,6 +160,7 @@ int SYMEXPORT alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data) int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) { alpm_trans_t *trans; + alpm_event_any_t event; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -197,6 +198,8 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) trans->state = STATE_COMMITING; alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction started\n"); + event.type = ALPM_EVENT_TRANSACTION_START; + EVENT(handle, &event); if(trans->add == NULL) { if(_alpm_remove_packages(handle, 1) == -1) { @@ -219,6 +222,8 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) if(trans->state == STATE_INTERRUPTED) { alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction interrupted\n"); } else { + event.type = ALPM_EVENT_TRANSACTION_DONE; + EVENT(handle, &event); alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction completed\n"); _alpm_hook_run(handle, ALPM_HOOK_POST_TRANSACTION); } |