index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2007-01-30 05:41:13 +0000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-01-30 05:41:13 +0000 |
commit | 0bc06918e4b93cae874c09f4b1d487865ca44fbd (patch) | |
tree | a10a1a774d49fb06b42b60eaa072a85889b8e88a /lib/libalpm/deps.c | |
parent | e668b471426d7c8c406ace6ad05d0c5aefc56dea (diff) |
-rw-r--r-- | lib/libalpm/deps.c | 13 |
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 0b4af443..0de9b930 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -106,6 +106,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int mode) int change = 1; int numscans = 0; int numtargs = 0; + int maxscans; if(targets == NULL) { return(NULL); @@ -116,15 +117,13 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int mode) numtargs++; } + maxscans = (int)sqrt(numtargs); + _alpm_log(PM_LOG_DEBUG, _("started sorting dependencies")); while(change) { alpm_list_t *tmptargs = NULL; change = 0; - /* TODO only use of a math.h function in entire libalpm, - * can we get rid of it? Former code line: - *if(numscans > numtargs) { - */ - if(numscans > sqrt(numtargs)) { + if(numscans > maxscans) { _alpm_log(PM_LOG_DEBUG, _("possible dependency cycle detected")); continue; } @@ -321,9 +320,9 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op, /* else if still not found... */ if(!found) { _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as a dependency for %s"), - depend.name, tp->name); + depend.name, tp->name); miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod, - depend.name, depend.version); + depend.name, depend.version); if(!_alpm_depmiss_isin(miss, baddeps)) { baddeps = alpm_list_add(baddeps, miss); } else { |