From bde9d69636a2f1842be83e4cd36188b66df74e26 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Sat, 7 Jan 2006 17:59:26 +0000 Subject: added more debug logs in the sync conflict/replace code --- lib/libalpm/deps.c | 14 ++++++++++---- lib/libalpm/sync.c | 19 ++++++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 7d0d91eb..6167c7ce 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -601,12 +601,14 @@ int resolvedeps(pmdb_t *local, PMList *dbs_sync, pmpkg_t *syncpkg, PMList *list, pmpkg_t *sync = NULL; int provisio_match = 0; + _alpm_log(PM_LOG_DEBUG, "resolving dependency %s", miss->depend.name); + /* check if one of the packages in *list already provides this dependency */ for(j = list; j; j = j->next) { pmpkg_t *sp = (pmpkg_t*)j->data; for(k = sp->provides; k; k = k->next) { if(!strcmp(miss->depend.name, k->data)) { - _alpm_log(PM_LOG_DEBUG, "%s provides dependency %s", sp->name, miss->depend.name); + _alpm_log(PM_LOG_DEBUG, "%s provides dependency %s -- skipping", sp->name, miss->depend.name); provisio_match = 1; } } @@ -638,7 +640,8 @@ int resolvedeps(pmdb_t *local, PMList *dbs_sync, pmpkg_t *syncpkg, PMList *list, FREELISTPTR(provides); } if(sync == NULL) { - _alpm_log(PM_LOG_ERROR, "cannot resolve dependencies for \"%s\" (\"%s\" is not in the package set)", miss->target, miss->depend.name); + _alpm_log(PM_LOG_ERROR, "cannot resolve dependencies for \"%s\" (\"%s\" is not in the package set)", + miss->target, miss->depend.name); pm_errno = PM_ERR_UNRESOLVABLE_DEPS; goto error; } @@ -646,6 +649,8 @@ int resolvedeps(pmdb_t *local, PMList *dbs_sync, pmpkg_t *syncpkg, PMList *list, for(j = list; j && !found; j = j->next) { pmpkg_t *tmp = j->data; if(tmp && !strcmp(tmp->name, sync->name)) { + _alpm_log(PM_LOG_DEBUG, "dependency %s is already in the target list - skipping", + sync->name); found = 1; } } @@ -653,7 +658,7 @@ int resolvedeps(pmdb_t *local, PMList *dbs_sync, pmpkg_t *syncpkg, PMList *list, /* this dep is already in the target list */ continue; } - _alpm_log(PM_LOG_DEBUG, "resolving %s", sync->name); + found = 0; for(j = trail; j; j = j->next) { pmpkg_t *tmp = j->data; @@ -682,7 +687,8 @@ int resolvedeps(pmdb_t *local, PMList *dbs_sync, pmpkg_t *syncpkg, PMList *list, if(resolvedeps(local, dbs_sync, sync, list, trail, trans)) { goto error; } - _alpm_log(PM_LOG_FLOW2, "adding dependency %s-%s", sync->name, sync->version); + _alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)", + sync->name, syncpkg->name); list = pm_list_add(list, sync); } else { _alpm_log(PM_LOG_ERROR, "cannot resolve dependencies for \"%s\"", miss->target); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 00e3d5a8..a743099a 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -144,6 +144,7 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync) pmpkg_t *spkg = j->data; for(k = spkg->replaces; k; k = k->next) { PMList *m; + _alpm_log(PM_LOG_DEBUG, "looking replacement %s for package %s", k->data, spkg->name); for(m = db_get_pkgcache(db_local); m; m = m->next) { pmpkg_t *lpkg = m->data; if(!strcmp(k->data, lpkg->name)) { @@ -361,7 +362,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList ** _alpm_log(PM_LOG_FLOW1, "resolving targets dependencies"); for(i = trans->packages; i; i = i->next) { pmpkg_t *spkg = ((pmsyncpkg_t *)i->data)->pkg; - _alpm_log(PM_LOG_FLOW1, "resolving dependencies for package %s", spkg->name); + _alpm_log(PM_LOG_DEBUG, "resolving dependencies for package %s", spkg->name); if(resolvedeps(db_local, dbs_sync, spkg, list, trail, trans) == -1) { /* pm_errno is set by resolvedeps */ goto error; @@ -372,10 +373,13 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList ** pmpkg_t *spkg = i->data; if(!find_pkginsync(spkg->name, trans->packages)) { pmsyncpkg_t *sync = sync_new(PM_SYNC_TYPE_DEPEND, spkg, NULL); + /* ORE - the trans->packages list should be sorted to stay compatible with + * pacman 2.x */ trans->packages = pm_list_add(trans->packages, sync); + _alpm_log(PM_LOG_FLOW2, "adding package %s-%s to the transaction targets", + spkg->name, spkg->version); } } - EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL); /* check for inter-conflicts and whatnot */ @@ -411,10 +415,14 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList ** for(i = deps; i && !errorout; i = i->next) { pmdepmissing_t *miss = i->data; PMList *k; + if(miss->type != PM_DEP_TYPE_CONFLICT) { continue; } + _alpm_log(PM_LOG_DEBUG, "package %s is conflicting with %s", + miss->target, miss->depend.name); + /* check if the conflicting package is one that's about to be removed/replaced. * if so, then just ignore it */ @@ -424,6 +432,8 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList ** for(k = sync->data; k && !found; k = k->next) { pmpkg_t *p = k->data; if(!strcmp(p->name, miss->depend.name)) { + _alpm_log(PM_LOG_DEBUG, "%s is already elected for removal -- skipping", + miss->depend.name); found = 1; } } @@ -440,7 +450,6 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList ** * so just treat it like a "replaces" item so the REQUIREDBY * fields are inherited properly. */ - if(db_get_pkgfromcache(db_local, miss->depend.name) == NULL) { char *rmpkg = NULL; /* hmmm, depend.name isn't installed, so it must be conflicting @@ -474,6 +483,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList ** pmsyncpkg_t *spkg; trans->packages = _alpm_list_remove(trans->packages, sync, ptr_cmp, (void **)&spkg); FREESYNC(spkg); + _alpm_log(PM_LOG_DEBUG, "removing %s from target list", rmpkg); } } solved = 1; @@ -485,6 +495,9 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList ** if(!solved) { /* It's a conflict -- see if they want to remove it */ + + _alpm_log(PM_LOG_DEBUG, "resolving package %s conflict", miss->target); + if(db_get_pkgfromcache(db_local, miss->depend.name)) { int doremove = 0; if(!pm_list_is_strin(miss->depend.name, asked)) { -- cgit v1.2.3-70-g09d2