summaryrefslogtreecommitdiff
path: root/src/solver.c
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-02-21 15:35:53 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-02-21 15:35:53 +0000
commit0dcbd933c8d3d305395a99b7b1690a187ce5ec8c (patch)
treeee05b6252904e071e201b67700b23ef7f660ee85 /src/solver.c
parentfa762cd47677a119eddd3bc0c075de9819739cd6 (diff)
downloadapk-tools-0dcbd933c8d3d305395a99b7b1690a187ce5ec8c.tar.gz
apk-tools-0dcbd933c8d3d305395a99b7b1690a187ce5ec8c.tar.bz2
apk-tools-0dcbd933c8d3d305395a99b7b1690a187ce5ec8c.tar.xz
apk-tools-0dcbd933c8d3d305395a99b7b1690a187ce5ec8c.zip
solver: allow names with only one provider to be autoselected regardless of priority
Diffstat (limited to 'src/solver.c')
-rw-r--r--src/solver.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/solver.c b/src/solver.c
index 91e5958..d27a7a3 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -671,11 +671,12 @@ static void select_package(struct apk_solver_state *ss, struct apk_name *name)
(!p->pkg->ss.iif_triggered ||
!p->pkg->ss.tag_ok))
continue;
- /* Virtual packages without provider_priority cannot be autoselected */
+ /* Virtual packages without provider_priority cannot be autoselected,
+ * unless there is only one provider */
if (p->version == &apk_null_blob &&
p->pkg->name->auto_select_virtual == 0 &&
p->pkg->name->ss.requirers == 0 &&
- p->pkg->provider_priority == 0)
+ (p->pkg->provider_priority == 0 && name->providers->num > 1))
continue;
if (compare_providers(ss, p, &chosen) > 0)
chosen = *p;