diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b5a9979..61e62d8 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -501,7 +501,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync for(i = deps; i; i = i->next) { pmconflict_t *conflict = i->data; - pmsyncpkg_t *rsync, *sync1, *sync2; + pmsyncpkg_t *rsync, *sync, *sync1, *sync2; /* have we already removed one of the conflicting targets? */ sync1 = _alpm_sync_find(trans->packages, conflict->package1); @@ -517,9 +517,11 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync if(alpm_list_find(alpm_pkg_get_provides(sync1->pkg), conflict->package2, _alpm_prov_cmp)) { rsync = sync2; + sync = sync1; } else if(alpm_list_find(alpm_pkg_get_provides(sync2->pkg), conflict->package1, _alpm_prov_cmp)) { rsync = sync1; + sync = sync2; } else { pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; @@ -528,6 +530,15 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync } _alpm_log(PM_LOG_DEBUG, "removing '%s' from target list\n", rsync->pkg->name); + /* Only prints a warning if rsync is an explicit target. + * Besides, if it isn't locally installed. it will be dealt with in a + * target vs db conflict anyway. */ + if(alpm_list_find_str(trans->targets, rsync->pkg->name) && + !_alpm_db_get_pkgfromcache(db_local, rsync->pkg->name)) { + _alpm_log(PM_LOG_WARNING, + _("removing '%s' from target list because it conflicts with '%s'\n"), + rsync->pkg->name, sync->pkg->name); + } void *vpkg; trans->packages = alpm_list_remove(trans->packages, rsync, syncpkg_cmp, &vpkg);