Index: conflict.c
===================================================================
RCS file: /home/cvs-pacman/pacman-lib/lib/libalpm/conflict.c,v
retrieving revision 1.15
diff -c -r1.15 conflict.c
*** conflict.c	21 Feb 2006 23:55:59 -0000	1.15
--- conflict.c	23 Feb 2006 22:06:08 -0000
***************
*** 131,141 ****
  			}
  		}
  		/* CHECK 3: check database against targets */
! 		for(k = _alpm_db_get_pkgcache(db); k; k = k->next) {
  			PMList *conflicts = NULL;
! 			int usenewconflicts = 0;
! 
! 			info = k->data;
  			if(!strcmp(info->name, tp->name)) {
  				/* a package cannot conflict with itself -- that's just not nice */
  				continue;
--- 131,139 ----
  			}
  		}
  		/* CHECK 3: check database against targets */
! 		for(j = _alpm_db_get_pkgcache(db); j; j = j->next) {
  			PMList *conflicts = NULL;
! 			info = j->data;
  			if(!strcmp(info->name, tp->name)) {
  				/* a package cannot conflict with itself -- that's just not nice */
  				continue;
***************
*** 143,165 ****
  			/* If this package (*info) is also in our packages PMList, use the
  			 * conflicts list from the new package, not the old one (*info)
  			 */
! 			for(j = packages; j; j = j->next) {
! 				pmpkg_t *pkg = j->data;
  				if(!strcmp(pkg->name, info->name)) {
  					/* Use the new, to-be-installed package's conflicts */
  					conflicts = pkg->conflicts;
- 					usenewconflicts = 1;
  				}
  			}
! 			if(!usenewconflicts) {
  				/* Use the old package's conflicts, it's the only set we have */
  				conflicts = info->conflicts;
  			}
! 			for(j = conflicts; j; j = j->next) {
! 				if(!strcmp((char *)j->data, tp->name)) {
  					_alpm_log(PM_LOG_DEBUG, "db vs targs: found %s as a conflict for %s",
! 					          info->name, tp->name);
! 					miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, info->name, NULL);
  					if(!_alpm_depmiss_isin(miss, baddeps)) {
  						baddeps = _alpm_list_add(baddeps, miss);
  					} else {
--- 141,162 ----
  			/* If this package (*info) is also in our packages PMList, use the
  			 * conflicts list from the new package, not the old one (*info)
  			 */
! 			for(k = packages; k && !conflicts; k = k->next) {
! 				pmpkg_t *pkg = k->data;
  				if(!strcmp(pkg->name, info->name)) {
  					/* Use the new, to-be-installed package's conflicts */
  					conflicts = pkg->conflicts;
  				}
  			}
! 			if(!conflicts) {
  				/* Use the old package's conflicts, it's the only set we have */
  				conflicts = info->conflicts;
  			}
! 			for(k = conflicts; k; k = k->next) {
! 				if(!strcmp((char *)k->data, tp->name)) {
  					_alpm_log(PM_LOG_DEBUG, "db vs targs: found %s as a conflict for %s",
! 					          tp->name, info->name);
! 					miss = _alpm_depmiss_new(info->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, tp->name, NULL);
  					if(!_alpm_depmiss_isin(miss, baddeps)) {
  						baddeps = _alpm_list_add(baddeps, miss);
  					} else {
***************
*** 173,180 ****
  						for(n = tp->provides; n; n = n->next) {
  							if(!strcmp(m->data, n->data)) {
  								_alpm_log(PM_LOG_DEBUG, "db vs targs: found %s as a conflict for %s",
! 								          info->name, tp->name);
! 								miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, info->name, NULL);
  								if(!_alpm_depmiss_isin(miss, baddeps)) {
  									baddeps = _alpm_list_add(baddeps, miss);
  								} else {
--- 170,177 ----
  						for(n = tp->provides; n; n = n->next) {
  							if(!strcmp(m->data, n->data)) {
  								_alpm_log(PM_LOG_DEBUG, "db vs targs: found %s as a conflict for %s",
! 								          tp->name, info->name);
! 								miss = _alpm_depmiss_new(info->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, tp->name, NULL);
  								if(!_alpm_depmiss_isin(miss, baddeps)) {
  									baddeps = _alpm_list_add(baddeps, miss);
  								} else {
