summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Brunel <jjk@jjacky.com>2015-12-06 18:35:37 +0100
committerAllan McRae <allan@archlinux.org>2015-12-15 06:09:28 +0100
commit132ec4c3b9f761fb76ff9cf567f3723db62d72df (patch)
tree0738399fbebaf4c7456446fa21110b91c53a9c6a /src
parent3802cab56374b50d4775d9deaf229cdef5cdbe53 (diff)
downloadpacman-132ec4c3b9f761fb76ff9cf567f3723db62d72df.tar.gz
pacman-132ec4c3b9f761fb76ff9cf567f3723db62d72df.tar.xz
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 <jjk@jjacky.com>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c8
1 files changed, 8 insertions, 0 deletions
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: