summaryrefslogtreecommitdiff
path: root/src/solver.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-08-24 15:26:25 +0300
committerTimo Teräs <timo.teras@iki.fi>2020-08-24 15:26:25 +0300
commite2afc7e7a9960eaf6cb40267bc1f39aa6638dccb (patch)
tree267888911a9f46b096e5c76689c6f1fbf5acea28 /src/solver.c
parentf3cf824948f11cd7b9af4b7e7232c71b5e96d89b (diff)
downloadapk-tools-e2afc7e7a9960eaf6cb40267bc1f39aa6638dccb.tar.gz
apk-tools-e2afc7e7a9960eaf6cb40267bc1f39aa6638dccb.tar.bz2
apk-tools-e2afc7e7a9960eaf6cb40267bc1f39aa6638dccb.tar.xz
apk-tools-e2afc7e7a9960eaf6cb40267bc1f39aa6638dccb.zip
fix, simplify and document upgrade --ignore
Diffstat (limited to 'src/solver.c')
-rw-r--r--src/solver.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/solver.c b/src/solver.c
index 7d3654b..df63060 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -53,6 +53,8 @@ void apk_solver_set_name_flags(struct apk_name *name,
foreach_array_item(p, name->providers) {
struct apk_package *pkg = p->pkg;
+ dbg_printf("marking '" PKG_VER_FMT "' = 0x%04x / 0x%04x\n",
+ PKG_VER_PRINTF(pkg), solver_flags, solver_flags_inheritable);
pkg->ss.solver_flags |= solver_flags;
pkg->ss.solver_flags_inheritable |= solver_flags_inheritable;
}
@@ -564,10 +566,10 @@ static int compare_providers(struct apk_solver_state *ss,
/* Prefer installed on self-upgrade */
if ((db->performing_self_upgrade && !(solver_flags & APK_SOLVERF_UPGRADE)) ||
- (solver_flags & APK_SOLVERF_IGNORE_UPGRADE)) {
+ (solver_flags & APK_SOLVERF_INSTALLED)) {
r = (pkgA->ipkg != NULL) - (pkgB->ipkg != NULL);
if (r) {
- dbg_printf(" prefer installed on self-upgrade\n");
+ dbg_printf(" prefer installed\n");
return r;
}
}
@@ -603,8 +605,7 @@ static int compare_providers(struct apk_solver_state *ss,
}
/* Prefer installed */
- if (!(solver_flags & APK_SOLVERF_UPGRADE) ||
- (solver_flags & APK_SOLVERF_IGNORE_UPGRADE)) {
+ if (!(solver_flags & APK_SOLVERF_UPGRADE)) {
r = (pkgA->ipkg != NULL) - (pkgB->ipkg != NULL);
if (r) {
dbg_printf(" prefer installed\n");