diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-06-18 08:03:40 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-06-18 08:03:40 +0300 |
commit | 01ec60f718c388f620598c39bdc0816a0dbe09ac (patch) | |
tree | 0d3f482967c0453ee240185c2cda41e411616675 /src/solver.c | |
parent | 54509e7a1a33923569848ce69c6e7f94fc6a021b (diff) | |
download | apk-tools-01ec60f718c388f620598c39bdc0816a0dbe09ac.tar.gz apk-tools-01ec60f718c388f620598c39bdc0816a0dbe09ac.tar.bz2 apk-tools-01ec60f718c388f620598c39bdc0816a0dbe09ac.tar.xz apk-tools-01ec60f718c388f620598c39bdc0816a0dbe09ac.zip |
errors: improve analysis for virtual packages
if all packages named N provide the virtual package, list only the
name N instead of all packages providing it.
Diffstat (limited to 'src/solver.c')
-rw-r--r-- | src/solver.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/solver.c b/src/solver.c index 279d1f6..b1a078c 100644 --- a/src/solver.c +++ b/src/solver.c @@ -529,10 +529,14 @@ 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) { + /* Ensure valid pinning and install-if trigger */ if (name->ss.requirers == 0 && (!p->pkg->ss.iif_triggered || !p->pkg->ss.tag_ok)) continue; + /* Virtual packages cannot be autoselected */ + if (p->version == &apk_null_blob && p->pkg->name->ss.requirers == 0) + continue; if (compare_providers(ss, p, &chosen) > 0) chosen = *p; } @@ -540,12 +544,6 @@ static void select_package(struct apk_solver_state *ss, struct apk_name *name) pkg = chosen.pkg; if (pkg) { - if (chosen.version == &apk_null_blob) { - /* Pure virtual package */ - assign_name(ss, name, provider_none); - ss->errors += (name->ss.requirers > 0); - return; - } if (!pkg->ss.available || !pkg->ss.tag_ok) { /* Selecting broken or unallowed package */ mark_error(ss, pkg); |