From ac30eb2c1e452df5c4e4992038b24b26cfcd5ced Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sun, 15 Oct 2006 23:54:43 +0000 Subject: Applied Frugalware patch from Christian Hamar alias krix for file-conflict progress bar Also did some CVS cleanup, removing some of the autogenerated files that shouldn't have been there --- lib/libalpm/conflict.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/conflict.c') diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 8cfe0f6e..2c63143e 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -201,21 +201,24 @@ PMList *_alpm_checkconflicts(pmdb_t *db, PMList *packages) return(baddeps); } -PMList *_alpm_db_find_conflicts(pmdb_t *db, PMList *targets, char *root, PMList **skip_list) +PMList *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root, PMList **skip_list) { PMList *i, *j, *k; char *filestr = NULL; char path[PATH_MAX+1]; struct stat buf, buf2; PMList *conflicts = NULL; + PMList *targets = trans->packages; + double percent; if(db == NULL || targets == NULL || root == NULL) { return(NULL); } - /* CHECK 1: check every target against every target */ for(i = targets; i; i = i->next) { pmpkg_t *p1 = (pmpkg_t*)i->data; + percent = (double)(_alpm_list_count(targets) - _alpm_list_count(i) + 1) / _alpm_list_count(targets); + PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (percent * 100), _alpm_list_count(targets), (_alpm_list_count(targets) - _alpm_list_count(i) +1)); for(j = i; j; j = j->next) { pmpkg_t *p2 = (pmpkg_t*)j->data; if(strcmp(p1->name, p2->name)) { -- cgit v1.2.3