From 08dca1593f82dfa4b5f1199b5b1f4d7099719be9 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 1 Dec 2006 09:32:29 +0000 Subject: * Cosmetic changes and typo fixes * IgnorePkg and --ignore work again * Partial changes to support removal of conflicts for -U and -A (INCOMPLETE) --- lib/libalpm/add.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/add.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 2c33947b..957cd69b 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -206,9 +206,15 @@ error: return(-1); } + +static int name_cmp(const void *p1, const void *p2) +{ + return(strcmp(((pmpkg_t *)p1)->name, (const char *)p2)); +} + int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, pmlist_t **data) { - pmlist_t *lp; + pmlist_t *lp = NULL, *i = NULL; pmlist_t *rmlist = NULL; char rm_fname[PATH_MAX]; pmpkg_t *info = NULL; @@ -236,6 +242,18 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, pmlist_t **data) /* no unsatisfied deps, so look for conflicts */ _alpm_log(PM_LOG_FLOW1, _("looking for conflicts")); lp = _alpm_checkconflicts(db, trans->packages); + for(i = lp; i; i = i->next) { + int skip_this = 0; + pmdepmissing_t *miss = i->data; + + /* Attempt to resolve conflicts */ + QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target, miss->depend.name, NULL, &skip_this); + if(skip_this) { + pmpkg_t *pkg = NULL; + lp = _alpm_list_remove(lp, miss->depend.name, name_cmp, (void **)&pkg); + FREEPKG(pkg); + } + } if(lp != NULL) { if(data) { *data = lp; -- cgit v1.2.3-24-g4f1b