From 132ec4c3b9f761fb76ff9cf567f3723db62d72df Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Sun, 6 Dec 2015 18:35:37 +0100 Subject: Add events ALPM_EVENT_HOOK_{START,DONE} Add events to let frontends know when hooks are being processed (and when it's done), as that might be useful to update the UI. Signed-off-by: Olivier Brunel --- src/pacman/callback.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 7a21b22c..b8ded3d0 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -167,6 +167,13 @@ void cb_event(alpm_event_t *event) return; } switch(event->type) { + case ALPM_EVENT_HOOK_START: + if(event->hook.when == ALPM_HOOK_PRE_TRANSACTION) { + colon_printf(_("Running pre-transaction hooks...\n")); + } else { + colon_printf(_("Running post-transaction hooks...\n")); + } + break; case ALPM_EVENT_CHECKDEPS_START: printf(_("checking dependencies...\n")); break; @@ -329,6 +336,7 @@ void cb_event(alpm_event_t *event) case ALPM_EVENT_DISKSPACE_DONE: case ALPM_EVENT_RETRIEVE_DONE: case ALPM_EVENT_RETRIEVE_FAILED: + case ALPM_EVENT_HOOK_DONE: /* we can safely ignore those as well */ case ALPM_EVENT_PKGDOWNLOAD_START: case ALPM_EVENT_PKGDOWNLOAD_DONE: -- cgit v1.2.3-70-g09d2