diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-02-23 07:53:25 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-02-23 07:53:25 +0000 |
commit | faad70aa54df518282815e5fd09ddfb004bbeab5 (patch) | |
tree | b011239328324737b379c5ab706ad5545e0fb909 /lib/libalpm/sync.c | |
parent | ef448db47287184a5a2dc97321899ab0efc664ab (diff) | |
download | pacman-faad70aa54df518282815e5fd09ddfb004bbeab5.tar.xz |
* Too much debugging output in the alpm_pkg_compare_versions function
* Using the wrong info level for replacements
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r-- | lib/libalpm/sync.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 8cc50108..b6150a5a 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -121,28 +121,34 @@ static pmsyncpkg_t *find_pkginsync(char *needle, alpm_list_t *haystack) static int find_replacements(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync) { - alpm_list_t *i, *j, *k; + alpm_list_t *i, *j, *k, *m; /* wow */ ALPM_LOG_FUNC; /* check for "recommended" package replacements */ _alpm_log(PM_LOG_DEBUG, _("checking for package replacements")); for(i = dbs_sync; i; i = i->next) { - for(j = _alpm_db_get_pkgcache(i->data, INFRQ_DEPENDS); j; j = j->next) { + pmdb_t *db = i->data; + + /* for each db, check each package's REPLACES list */ + for(j = _alpm_db_get_pkgcache(db, INFRQ_DESC); j; j = j->next) { pmpkg_t *spkg = j->data; - for(k = spkg->replaces; k; k = k->next) { - alpm_list_t *m; + + for(k = alpm_pkg_get_replaces(spkg); k; k = k->next) { + const char *replacement = k->data; + /* compare to local DB */ for(m = _alpm_db_get_pkgcache(db_local, INFRQ_NONE); m; m = m->next) { pmpkg_t *lpkg = m->data; - if(strcmp(k->data, lpkg->name) == 0) { - _alpm_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), k->data, spkg->name); + + if(strcmp(replacement, lpkg->name) == 0) { + _alpm_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), replacement, spkg->name); if(alpm_list_find_str(handle->ignorepkg, lpkg->name)) { _alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (to be replaced by %s-%s)"), lpkg->name, lpkg->version, spkg->name, spkg->version); } else { /* get confirmation for the replacement */ int doreplace = 0; - QUESTION(trans, PM_TRANS_CONV_REPLACE_PKG, lpkg, spkg, ((pmdb_t *)i->data)->treename, &doreplace); + QUESTION(trans, PM_TRANS_CONV_REPLACE_PKG, lpkg, spkg, db->treename, &doreplace); if(doreplace) { /* if confirmed, add this to the 'final' list, designating 'lpkg' as |