On Tue, Jul 10, 2007 at 08:56:05PM +0200, ngaba@petra.hos.u-szeged.hu wrote:
Hi!
I attached a cleanup patch for resolvedeps + a pathologic pactest file to demonstrate, that the old version was negligent. See my notes about alpm_depcmp's speed here: http://www.archlinux.org/pipermail/pacman-dev/2007-June/008539.html
I started looking at the current resolvedeps, and there was a part I didn't understand, it only looked at provides and not at the name of the package itself (there was the same mistake in other parts of the code), so I just used alpm_depcmp as you always recommend and that one line change fix your pactest :) diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 591e5a8..3137f8b 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -613,7 +613,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, /* check if one of the packages in *list already provides this dependency */ for(j = list; j && !found; j = j->next) { pmpkg_t *sp = j->data; - if(alpm_list_find_str(alpm_pkg_get_provides(sp), miss->depend.name)) { + if(alpm_depcmp(sp, &miss->depend)) { _alpm_log(PM_LOG_DEBUG, "%s provides dependency %s -- skipping", alpm_pkg_get_name(sp), miss->depend.name); found = 1; Of course that change is already in your patch ;) The other changes look nice too at first sight, but I need to have a closer look at them, hopefully tomorrow.