diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-06-11 14:06:06 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-06-13 18:22:00 +0300 |
commit | b8c44536ca911418fee1c9ab4eecbb913a1ca852 (patch) | |
tree | a89e68b12f4d3daf089c475beeb71c53ffb8cc3a /src/cache.c | |
parent | f292a858677ae0e1af8910ffbd4b338f4b36c18b (diff) | |
download | apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.gz apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.bz2 apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.xz apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.zip |
solver: rewrite as deductive solver -- core features
Implementing basic dependency handling, install_if and awareness
of pinning.
Diffstat (limited to 'src/cache.c')
-rw-r--r-- | src/cache.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cache.c b/src/cache.c index f295f89..fc58f7e 100644 --- a/src/cache.c +++ b/src/cache.c @@ -34,7 +34,7 @@ static int cache_download(struct apk_database *db) char item[PATH_MAX], cacheitem[PATH_MAX]; int i, r, ret = 0; - r = apk_solver_solve(db, 0, db->world, NULL, &changeset); + r = apk_solver_solve(db, 0, db->world, &changeset); if (r < 0) { apk_error("Unable to select packages. Run apk fix."); return r; @@ -42,9 +42,8 @@ static int cache_download(struct apk_database *db) for (i = 0; i < changeset.changes->num; i++) { change = &changeset.changes->item[i]; - pkg = change->newpkg; - - if (pkg->repos & db->local_repos) + pkg = change->new_pkg; + if ((pkg == NULL) || (pkg->repos & db->local_repos)) continue; repo = apk_db_select_repo(db, pkg); |