diff options
author | Nagy Gabor <ngaba@petra.hos.u-szeged.hu> | 2007-06-10 01:16:51 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-06-10 17:25:20 -0400 |
commit | 97ba9c92275bfc81cc5b33c90e1ea696a52d837d (patch) | |
tree | 061e56971e793ad0d2e354965cda4380c39e2685 | |
parent | 970f15d83288d55bdb0c3cc1f55ff4b8428512ae (diff) | |
download | pacman-97ba9c92275bfc81cc5b33c90e1ea696a52d837d.tar.xz |
Fix issue when upgrading two packages that would break deps
Fixes for pactest upgrade060. Posted on the ML here:
http://archlinux.org/pipermail/pacman-dev/2007-April/008130.html
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | lib/libalpm/deps.c | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 2a441d3c..bd73d60b 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -315,40 +315,20 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op, } found = 0; - /* check database for literal packages */ - for(k = _alpm_db_get_pkgcache(db); k && !found; k = k->next) { - pmpkg_t *p = (pmpkg_t *)k->data; - found = alpm_depcmp(p, depend); - } - /* check database for provides matches */ - if(!found) { - alpm_list_t *m; - for(m = _alpm_db_whatprovides(db, depend->name); m && !found; m = m->next) { - /* look for a match that isn't one of the packages we're trying - * to install. this way, if we match against a to-be-installed - * package, we'll defer to the NEW one, not the one already - * installed. */ - pmpkg_t *p = m->data; - alpm_list_t *n; - int skip = 0; - for(n = packages; n && !skip; n = n->next) { - pmpkg_t *ptp = n->data; - if(strcmp(alpm_pkg_get_name(ptp), alpm_pkg_get_name(p)) == 0) { - skip = 1; - } - } - if(skip) { - continue; - } - - found = alpm_depcmp(p, depend); - } - } /* check other targets */ for(k = packages; k && !found; k = k->next) { pmpkg_t *p = k->data; found = alpm_depcmp(p, depend); } + + /* check database for satisfying packages */ + /* we can ignore packages being updated, they were checked above */ + for(k = _alpm_db_get_pkgcache(db); k && !found; k = k->next) { + pmpkg_t *p = k->data; + found = alpm_depcmp(p, depend) + && !_alpm_pkg_find(alpm_pkg_get_name(p), packages); + } + /* else if still not found... */ if(!found) { _alpm_log(PM_LOG_DEBUG, _("missing dependency '%s' for package '%s'"), |