From 043660122488e93d6346893db06cfa030aaa6f67 Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Sun, 10 Jun 2007 01:32:29 +0200 Subject: Small speed-tuning to upgrade-checkdep Posted on the ML here: http://archlinux.org/pipermail/pacman-dev/2007-April/008131.html Signed-off-by: Dan McGee --- lib/libalpm/deps.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index bd73d60b..bcb7ef53 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -233,14 +233,16 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op, for(j = alpm_pkg_get_requiredby(oldpkg); j; j = j->next) { pmpkg_t *p; found = 0; - if((p = _alpm_db_get_pkgfromcache(db, j->data)) == NULL) { - /* hmmm... package isn't installed.. */ + + if(_alpm_pkg_find(j->data, packages)) { + /* this package also in the upgrade list, so don't worry about it */ continue; } - if(_alpm_pkg_find(alpm_pkg_get_name(p), packages)) { - /* this package also in the upgrade list, so don't worry about it */ + if((p = _alpm_db_get_pkgfromcache(db, j->data)) == NULL) { + /* hmmm... package isn't installed.. */ continue; } + for(k = alpm_pkg_get_depends(p); k; k = k->next) { /* don't break any existing dependencies (possible provides) */ pmdepend_t *depend = alpm_splitdep(k->data); -- cgit v1.2.3-70-g09d2