Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-12-01 09:32:29 +0000
committerAaron Griffin <aaron@archlinux.org>2006-12-01 09:32:29 +0000
commit08dca1593f82dfa4b5f1199b5b1f4d7099719be9 (patch)
treeb1b383f93524ebfcb5bfcc98924668f29dc88ba3 /lib/libalpm/add.c
parent6c68723905ba1d8cee83e4af88b0ac8ee9a408aa (diff)
* Cosmetic changes and typo fixes
* IgnorePkg and --ignore work again * Partial changes to support removal of conflicts for -U and -A (INCOMPLETE)
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c20
1 files changed, 19 insertions, 1 deletions
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;