summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2019-06-03 14:53:46 +0300
committerTimo Teräs <timo.teras@iki.fi>2019-06-05 08:51:00 +0300
commitb0be9f610c02bb2d5e681a3904940d311e9de298 (patch)
treeb3b43259e590427a9e3b880330f54aa354a6dd5e
parent1c47f374434aa66fb6620199fd027b96cee446e6 (diff)
downloadapk-tools-b0be9f610c02bb2d5e681a3904940d311e9de298.tar.bz2
apk-tools-b0be9f610c02bb2d5e681a3904940d311e9de298.tar.xz
solver: fix common dependency merging to inherit pinning and flags
Notably this fixes occasional issues when doing upgrade with multiple versions of same packages. Without this the upgrade flag is not always propagated properly down the dependency chain.
-rw-r--r--src/solver.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/solver.c b/src/solver.c
index e10cf8b..2121dd9 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -462,6 +462,8 @@ static void reconsider_name(struct apk_solver_state *ss, struct apk_name *name)
name->name, name0->name);
name0->ss.requirers++;
name_requirers_changed(ss, name0);
+ foreach_array_item(p, name0->providers)
+ inherit_pinning_and_flags(ss, p->pkg, pkg);
}
}
}
@@ -510,7 +512,6 @@ static int compare_providers(struct apk_solver_state *ss,
unsigned int solver_flags;
int r;
-
/* Prefer existing package */
if (pkgA == NULL || pkgB == NULL)
return (pkgA != NULL) - (pkgB != NULL);
@@ -675,8 +676,11 @@ static void select_package(struct apk_solver_state *ss, struct apk_name *name)
if (name->ss.requirers || name->ss.has_iif) {
foreach_array_item(p, name->providers) {
- dbg_printf(" consider "PKG_VER_FMT" iif_triggered=%d, tag_ok=%d, selectable=%d, provider_priority=%d, installed=%d\n",
- PKG_VER_PRINTF(p->pkg), p->pkg->ss.iif_triggered, p->pkg->ss.tag_ok, p->pkg->ss.pkg_selectable,
+ dbg_printf(" consider "PKG_VER_FMT" iif_triggered=%d, tag_ok=%d, selectable=%d, available=%d, flags=0x%x, provider_priority=%d, installed=%d\n",
+ PKG_VER_PRINTF(p->pkg),
+ p->pkg->ss.iif_triggered, p->pkg->ss.tag_ok,
+ p->pkg->ss.pkg_selectable, p->pkg->ss.pkg_available,
+ p->pkg->ss.solver_flags,
p->pkg->provider_priority, p->pkg->ipkg != NULL);
/* Ensure valid pinning and install-if trigger */
if (name->ss.requirers == 0 &&