diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-01-22 16:23:16 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-01-22 16:23:16 +0200 |
commit | 528156a9fa51b52474199b93a9aa720e22c42cab (patch) | |
tree | d59917219ded25f385eec16b9a3908fa38680d98 | |
parent | 93bd3057135bd73befa2ae499f18a51b8749c142 (diff) | |
download | apk-tools-528156a9fa51b52474199b93a9aa720e22c42cab.tar.gz apk-tools-528156a9fa51b52474199b93a9aa720e22c42cab.tar.bz2 apk-tools-528156a9fa51b52474199b93a9aa720e22c42cab.tar.xz apk-tools-528156a9fa51b52474199b93a9aa720e22c42cab.zip |
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).
-rw-r--r-- | src/solver.c | 9 |
1 files changed, 8 insertions, 1 deletions
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--; |