diff options
author | Timo Teräs <timo.teras@iki.fi> | 2023-09-18 15:31:07 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2023-09-18 15:31:55 +0300 |
commit | 80f571ab394c2fbb0130bb6ae95f831a37e29814 (patch) | |
tree | af80346078b5ad2b4f0bff7acf307ec0473c071c | |
parent | b7ab9fa5432c9bdd95acae7b5d8fd8de1ee6f3f1 (diff) | |
download | apk-tools-80f571ab394c2fbb0130bb6ae95f831a37e29814.tar.gz apk-tools-80f571ab394c2fbb0130bb6ae95f831a37e29814.tar.bz2 apk-tools-80f571ab394c2fbb0130bb6ae95f831a37e29814.tar.xz apk-tools-80f571ab394c2fbb0130bb6ae95f831a37e29814.zip |
commit: properly propagate install-if status in error analysis
fixes #10883
-rw-r--r-- | src/commit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/commit.c b/src/commit.c index bca2557..5c7adba 100644 --- a/src/commit.c +++ b/src/commit.c @@ -616,7 +616,7 @@ static void analyze_deps(struct print_state *ps, struct apk_dependency_array *de foreach_array_item(d0, deps) { name0 = d0->name; if (d0->conflict) continue; - if ((name0->state_int & (STATE_PRESENT | STATE_MISSING)) != 0) + if ((name0->state_int & (STATE_INSTALLIF | STATE_PRESENT | STATE_MISSING)) != 0) continue; name0->state_int |= STATE_MISSING; analyze_missing_name(ps, name0); @@ -674,15 +674,19 @@ static void discover_name(struct apk_name *name, int pkg_state) foreach_array_item(p, name->providers) { int state = pkg_state; if (!p->pkg->marked) continue; - if (state == STATE_PRESENT && !p->pkg->provider_priority && - !is_name_concrete(p->pkg, name)) + if ((state == STATE_PRESENT || state == STATE_INSTALLIF) && + !p->pkg->provider_priority && !is_name_concrete(p->pkg, name)) state = STATE_VIRTUAL_ONLY; if (p->pkg->state_int & state) continue; p->pkg->state_int |= state; p->pkg->name->state_int |= state; - foreach_array_item(d, p->pkg->provides) - d->name->state_int |= state; + foreach_array_item(d, p->pkg->provides) { + int dep_state = state; + if (dep_state == STATE_INSTALLIF && d->version == &apk_atom_null) + dep_state = STATE_VIRTUAL_ONLY; + d->name->state_int |= dep_state; + } discover_deps(p->pkg->depends); if (state == STATE_PRESENT || state == STATE_INSTALLIF) { |