From 528156a9fa51b52474199b93a9aa720e22c42cab Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Tue, 22 Jan 2013 16:23:16 +0200 Subject: solver: do not backtrack over "exclude none" Otherwise we can return no solution at all instead of partially satisfied solution (and give proper error message). --- src/solver.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/solver.c b/src/solver.c index 3943bad..e7b1afb 100644 --- a/src/solver.c +++ b/src/solver.c @@ -971,8 +971,15 @@ static int next_branch(struct apk_solver_state *ss) d->name->ss.backjump_enabled = 0; backjump_name = NULL; } - if (d->backup_until && backup_until > d->backup_until) + if (d->backup_until && d->backup_until < backup_until) { backup_until = d->backup_until; + /* We can't backtrack over the immediate + * EXCLUDE decisions, as they are in a sense + * part of the bundle. */ + while (backup_until < ss->num_decisions && + !ss->decisions[backup_until+1].has_package) + backup_until++; + } } ss->num_decisions--; -- cgit v1.2.3-70-g09d2