summaryrefslogtreecommitdiff
path: root/src/solver.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-27solver: don't clobber package swaps in cases where an installed package is ↵William Pitcock1-5/+18
being replaced by a provider
2017-02-27fetch: fix --recursive mode to work with pure virtual packagesTimo Teräs1-1/+3
The virtual package provider still needs to be explicitly given on command line.
2016-07-22upgrade: improve self upgrade functionality a bitTimo Teräs1-4/+5
trigger it only if apk-tools can be upgrade, add test cases
2015-12-10solver: more debug output for package errorsTimo Teräs1-7/+11
2015-01-30sort world dependencies alphabeticallyTimo Teräs1-0/+8
this makes 'lbu diff' and aaudit diffs nice when a world dependency is added or removed. sorting also makes the ordering more deterministic as the world targets constraints are always applied in the same order. test suite updated accordingly.
2015-01-30remove reverse dependencies firstTimo Teräs1-0/+6
when removing large sets of packets, the ordering of removal was not quaranteed to honor dependencies. this fixes the removal order to be in reverse dependency order as far as possible.
2014-10-06solver: enforce conflicts during upgrades and new pkg installsTimo Teräs1-2/+11
This makes sure any conflicted packages will be removed first. Useful if we know there are conflicting files, and want to avoid adding potentially harmful replaces line. Add a test case for this too.
2014-05-19solver: fix installation of non-repository packages during tmpfs bootTimo Teräs1-2/+6
allow packages in the cache's installed to be selected for installation by the solver. add test case for the issue.
2014-04-10solver: purge install_if packages deleted from repositories on upgrade -aTimo Teräs1-2/+9
2014-04-10solver: fix cleaning of packages that got replaced by providesTimo Teräs1-1/+4
2014-04-04solver: fix inherited flags/pinning for install_if packagesTimo Teräs1-56/+28
noticeable fixes upgrading of packages which get pulled in only by install_if rule. this also simplifies the inheritance calculation for packages, as well as the place where it is done for install_if triggered packages.
2014-04-04solver: do not consider packages in cache as 'available'Timo Teräs1-5/+16
'available' really means 'available in one or more configured repository'. Cache is not a repository we track, so those are only available for installation, but not available as preferred to be installed from repository. fixes #2831.
2014-03-12solver: additional improvements to install_if handlingTimo Teräs1-4/+20
2014-03-11solver: fixes to install_if handlingTimo Teräs1-14/+21
2013-09-06solver: if pinning is specified, it overrides preferred reposTimo Teräs1-1/+1
add also a test case for this
2013-07-17solver: do not disqualify already disqualified packagesNatanael Copa1-1/+1
We should not disqualify non-selectable packages as it would mark it as dirty, forcing it to reconsider the name again, which could end up in an endless loop. fixes #2135
2013-07-04solver: use ffs (posix) instead of ffsl (gnu extension)Timo Teräs1-1/+2
for musl compatibility
2013-06-20solver: fix pinning+cache to workTimo Teräs1-16/+27
Mistakenly allowed masked out package to be installed if it was in cache.
2013-06-19solver: fix package deletion to consier provides properlyTimo Teräs1-22/+36
2013-06-19solver: properly order deletion of unneeded packagesTimo Teräs1-71/+129
2013-06-19solver: add logic: transitive provides exclusionTimo Teräs1-24/+65
If name N is required, and all providers of A also provide B, it means that only instances of B can be selected that provide N. This is strong help with cases when so:libfoo.so.1 is updated to so:libfoo.so.2 and not everything is recompiled.
2013-06-19upgrade: new option: --latest (-l)Timo Teräs1-56/+87
Select latest version of package (if it is not pinned), and print error if it cannot be installed due to other dependencies. Together with --available, it selects the latest package which is present at least in some repository. This also fixes few solver issues with ordering of package selection that got quite apparent with this flag. Namely, we cannot "lock" a package until it's reverse dependencies are locked or not all of the solver flags are propagated properly.
2013-06-18errors: improve analysis for virtual packagesTimo Teräs1-6/+4
if all packages named N provide the virtual package, list only the name N instead of all packages providing it.
2013-06-17db: refactor repository file constructionTimo Teräs1-1/+1
Fixes also 'fetch' applet to prefer copying/linking to files from cache if possible.
2013-06-14solver: use array_foreach_item and clean upsTimo Teräs1-156/+130
2013-06-13errors: rewrite the logic how errors are reportedTimo Teräs1-0/+3
Instead of the dependency oriented logic, switch to print them for each package or name needed. Might give a bit more readable errors now. There's still few corner cases that proper error is not output, which are cought by the test cases.
2013-06-13solver: prune broken world dependencies with --forceTimo Teräs1-22/+54
mostly useful for reboot, when all packages are not available.
2013-06-13solver: corner case fixesTimo Teräs1-3/+19
- try harder to not change anything during self-upgrade - also honor locking to packages that where earlier used in merging common dependencies - clarify upgrade applet help messages
2013-06-13solver: rewrite as deductive solver -- pinning supportTimo Teräs1-26/+135
Fix also pinning test cases to be more sane.
2013-06-13solver: rewrite as deductive solver -- per name flagsTimo Teräs1-8/+24
Handle properly per-name preference flags, and add test cases for testing those via fix applet.
2013-06-13solver: rewrite as deductive solver -- core featuresTimo Teräs1-1830/+418
Implementing basic dependency handling, install_if and awareness of pinning.
2013-06-12Revert "Revert "solver: increase score fields to 32-bits (from 16-bits)""William Pitcock1-21/+27
This reverts commit a2d873a77c6dd2e7f6219e6941af796e1f904e69.
2013-06-11Revert "solver: increase score fields to 32-bits (from 16-bits)"root1-27/+21
This reverts commit 84bfef1a6b587a7da7d12fb701ab0d1d5d6ce2a9.
2013-05-30db: unify handling of special packagesTimo Teräs1-8/+2
make cache a special kind of repository, and automatically cache special packages (virtual packages, or ones installed from command line). add test cases for handling virtual packages. fixes #1617.
2013-04-29solver: increase score fields to 32-bits (from 16-bits)Timo Teräs1-21/+27
We are having so many packages that they might overflow otherwise. "ERROR: Preference overflow" was already reported.
2013-01-28solver: remove backjumping by nameTimo Teräs1-28/+3
It is incorrect optimization causing valid solutions to be skipped. Any performance it might've gained, should be fixed by reintroduction of the minimum penalty logic added in previous commit.
2013-01-28solver: reintroduce minimum penalty logicTimo Teräs1-49/+55
Basic per-name per-package specific scoring added.
2013-01-22solver: do not backtrack over "exclude none"Timo Teräs1-1/+8
Otherwise we can return no solution at all instead of partially satisfied solution (and give proper error message).
2013-01-21solver: simplify strength evaluation in constraint handlingTimo Teräs1-20/+8
2013-01-21solver: check if solution is not found at allTimo Teräs1-0/+6
This is an internal error.
2013-01-18solver: fix reset of last_touched to zeroTimo Teräs1-2/+2
2013-01-18solver: some code clean upsTimo Teräs1-5/+5
2013-01-18solver: build fix for debug print on x86_64Natanael Copa1-1/+1
use %zu for size_t
2013-01-18solver: fix name assignment logic to not mess up internal stateTimo Teräs1-11/+10
Should get rid of error messages like: ERROR: Saved_score {4/0/0,74} != score {6/0/0,74}
2012-11-04solver: fix package prefence calculation a bitTimo Teräs1-1/+3
2012-10-08solver: additional backjumping schemeTimo Teräs1-11/+48
Enabled when all attempts to satisfy a name failed, we know that we can ignore all decisions until we find a decision affecting the name we wanted to satisfy.
2012-10-08solver: optimize backjumpingTimo Teräs1-7/+7
to be functional when backtracking
2012-10-08solver: properly calculate decision "strength" with providesTimo Teräs1-17/+13
2012-10-05solver: fix back jumping once moreTimo Teräs1-17/+33
2012-10-05solver: record dependency apk_name in apk_decisionTimo Teräs1-51/+19
We can't just use the primary name, as that would mess up backtracking. We need to record the name which caused the name to get considered - that way the right last_touched_decision is used on backtracking.