diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-02-24 08:42:40 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-02-24 08:42:40 +0200 |
commit | 4676c5d63ac70f4bf2c4e4c945a7fa65941676e9 (patch) | |
tree | 95cd25767adde7eb9f07240e22f8859984075bb7 /src/solver.c | |
parent | 1bb2fa7862bb896f1cfefca5bb9f1d0b477f49a5 (diff) | |
download | apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.tar.gz apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.tar.bz2 apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.tar.xz apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.zip |
test: improve pinning tests
Diffstat (limited to 'src/solver.c')
-rw-r--r-- | src/solver.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/solver.c b/src/solver.c index 39f9683..d12ecff 100644 --- a/src/solver.c +++ b/src/solver.c @@ -356,7 +356,7 @@ static int get_topology_score( }; if (ss->solver_flags & APK_SOLVERF_AVAILABLE) { - /* not upgrading: it is not preferred to change package */ + /* available preferred */ if ((pkg->repos == 0) && ns->has_available_pkgs) score.non_preferred_actions++; } else if (ns->inherited_reinstall || @@ -364,6 +364,9 @@ static int get_topology_score( /* reinstall requested, but not available */ if (!pkg_available(ss->db, pkg)) score.non_preferred_actions++; + } else if (ns->inherited_upgrade || + ((ns->solver_flags_local|ss->solver_flags) & APK_SOLVERF_UPGRADE)) { + /* upgrading - score is just locked here */ } else if ((ns->inherited_upgrade == 0) && ((ns->solver_flags_local|ss->solver_flags) & APK_SOLVERF_UPGRADE) == 0 && ((ns->solver_flags_maybe & APK_SOLVERF_UPGRADE) == 0 || (ps->locked))) { |