From 24684a616ed46c635a2236873c8168b9153b5bc1 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 16 Nov 2010 17:07:43 +1000 Subject: Display progress bar for disk space checking Checking disk space needed for a transaction can take a while so add an informative progress bar. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- src/pacman/callback.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/pacman') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 925f1fcf..f585b284 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -228,6 +228,11 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2) case PM_TRANS_EVT_RETRIEVE_START: printf(_(":: Retrieving packages from %s...\n"), (char*)data1); break; + case PM_TRANS_EVT_DISKSPACE_START: + if(config->noprogressbar) { + printf(_("checking available disk space...\n")); + } + break; /* all the simple done events, with fallthrough for each */ case PM_TRANS_EVT_FILECONFLICTS_DONE: case PM_TRANS_EVT_CHECKDEPS_DONE: @@ -236,6 +241,7 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2) case PM_TRANS_EVT_INTEGRITY_DONE: case PM_TRANS_EVT_DELTA_INTEGRITY_DONE: case PM_TRANS_EVT_DELTA_PATCHES_DONE: + case PM_TRANS_EVT_DISKSPACE_DONE: /* nothing */ break; } @@ -375,6 +381,9 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent, case PM_TRANS_PROGRESS_CONFLICTS_START: opr = _("checking for file conflicts"); break; + case PM_TRANS_PROGRESS_DISKSPACE_START: + opr = _("checking available disk space"); + break; default: return; } -- cgit v1.2.3-70-g09d2