summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-03-01 15:17:58 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-03-01 15:17:58 +0200
commit5ae0206d0b1ed64ef936b4de3bf27833c5892a59 (patch)
tree28867d1dccee308630ec6188417a9d3d4159b577
parent3e429a8100be9e7361e786258ffc582ebc54b3bd (diff)
downloadapk-tools-5ae0206d0b1ed64ef936b4de3bf27833c5892a59.tar.gz
apk-tools-5ae0206d0b1ed64ef936b4de3bf27833c5892a59.tar.bz2
apk-tools-5ae0206d0b1ed64ef936b4de3bf27833c5892a59.tar.xz
apk-tools-5ae0206d0b1ed64ef936b4de3bf27833c5892a59.zip
solver: properly set allowed flag for installed packages
-rw-r--r--src/solver.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/solver.c b/src/solver.c
index 447ab36..820f840 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -501,7 +501,10 @@ static void sort_soft_dependencies(struct apk_solver_state *ss,
static void update_allowed(struct apk_database *db, struct apk_package *pkg)
{
struct apk_package_state *ps = pkg_to_ps(pkg);
- if (pkg->repos & get_pinning_mask_repos(db, ps->allowed_pinning | APK_DEFAULT_PINNING_MASK))
+ unsigned int repos;
+
+ repos = pkg->repos | (pkg->ipkg ? db->repo_tags[pkg->ipkg->repository_tag].allowed_repos : 0);
+ if (repos & get_pinning_mask_repos(db, ps->allowed_pinning | APK_DEFAULT_PINNING_MASK))
ps->allowed = 1;
else
ps->allowed = 0;
@@ -1164,8 +1167,8 @@ static int reconsider_name(struct apk_solver_state *ss, struct apk_name *name)
name->ss.chosen = *next_p;
name->ss.preferred_chosen = (best_p == next_p);
- dbg_printf("reconsider_name: %s: next_pkg=%p [ version="BLOB_FMT" ]\n",
- name->name, next_p->pkg, BLOB_PRINTF(*name->ss.chosen.version));
+ dbg_printf("reconsider_name: %s: next_pkg="PKG_VER_FMT", preferred_chosen=%d\n",
+ name->name, PKG_VER_PRINTF(next_p->pkg), name->ss.preferred_chosen);
return SOLVERR_SOLUTION;
}