From 7d51882dd0afdb87fe986a7d7c672cc0be93795b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 8 Nov 2007 23:41:05 -0600 Subject: Simplify callback DONE event handling Move them all to a single fallthrough case statement since they all print "done". Signed-off-by: Dan McGee --- src/pacman/callback.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/pacman') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 5160b3b3..e935c870 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -177,12 +177,8 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2) printf(_("done.\n")); } break; - case PM_TRANS_EVT_CHECKDEPS_DONE: - case PM_TRANS_EVT_RESOLVEDEPS_DONE: - case PM_TRANS_EVT_INTERCONFLICTS_DONE: - printf(_("done.\n")); - break; case PM_TRANS_EVT_EXTRACT_DONE: + /* nothing */ break; case PM_TRANS_EVT_ADD_START: if(config->noprogressbar) { @@ -230,15 +226,9 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2) case PM_TRANS_EVT_INTEGRITY_START: printf(_("checking package integrity... ")); break; - case PM_TRANS_EVT_INTEGRITY_DONE: - printf(_("done.\n")); - break; case PM_TRANS_EVT_DELTA_INTEGRITY_START: printf(_("checking delta integrity... ")); break; - case PM_TRANS_EVT_DELTA_INTEGRITY_DONE: - printf(_("done.\n")); - break; case PM_TRANS_EVT_DELTA_PATCHES_START: printf(_("applying deltas...\n")); break; @@ -248,9 +238,6 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2) case PM_TRANS_EVT_DELTA_PATCH_START: printf(_("generating %s with %s... "), (char *)data1, (char *)data2); break; - case PM_TRANS_EVT_DELTA_PATCH_DONE: - printf(_("done.\n")); - break; case PM_TRANS_EVT_DELTA_PATCH_FAILED: printf(_("failed.\n")); break; @@ -262,9 +249,18 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2) break; case PM_TRANS_EVT_RETRIEVE_START: printf(_(":: Retrieving packages from %s...\n"), (char*)data1); - fflush(stdout); + break; + /* all the simple done events, with fallthrough for each */ + case PM_TRANS_EVT_CHECKDEPS_DONE: + case PM_TRANS_EVT_RESOLVEDEPS_DONE: + case PM_TRANS_EVT_INTERCONFLICTS_DONE: + case PM_TRANS_EVT_INTEGRITY_DONE: + case PM_TRANS_EVT_DELTA_INTEGRITY_DONE: + case PM_TRANS_EVT_DELTA_PATCH_DONE: + printf(_("done.\n")); break; } + fflush(stdout); } /* callback to handle questions from libalpm transactions (yes/no) */ -- cgit v1.2.3-70-g09d2