aboutsummaryrefslogtreecommitdiffstats
path: root/src/solver.c
Commit message (Collapse)AuthorAgeFilesLines
* solver: don't clobber package swaps in cases where an installed package is ↵William Pitcock2017-04-271-5/+18
| | | | being replaced by a provider
* fetch: fix --recursive mode to work with pure virtual packagesTimo Teräs2017-02-271-1/+3
| | | | | The virtual package provider still needs to be explicitly given on command line.
* upgrade: improve self upgrade functionality a bitTimo Teräs2016-07-221-4/+5
| | | | trigger it only if apk-tools can be upgrade, add test cases
* solver: more debug output for package errorsTimo Teräs2015-12-101-7/+11
|
* sort world dependencies alphabeticallyTimo Teräs2015-01-301-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.
* remove reverse dependencies firstTimo Teräs2015-01-301-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.
* solver: enforce conflicts during upgrades and new pkg installsTimo Teräs2014-10-061-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.
* solver: fix installation of non-repository packages during tmpfs bootTimo Teräs2014-05-191-2/+6
| | | | | allow packages in the cache's installed to be selected for installation by the solver. add test case for the issue.
* solver: purge install_if packages deleted from repositories on upgrade -aTimo Teräs2014-04-101-2/+9
|
* solver: fix cleaning of packages that got replaced by providesTimo Teräs2014-04-101-1/+4
|
* solver: fix inherited flags/pinning for install_if packagesTimo Teräs2014-04-041-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.
* solver: do not consider packages in cache as 'available'Timo Teräs2014-04-041-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.
* solver: additional improvements to install_if handlingTimo Teräs2014-03-121-4/+20
|
* solver: fixes to install_if handlingTimo Teräs2014-03-111-14/+21
|
* solver: if pinning is specified, it overrides preferred reposTimo Teräs2013-09-061-1/+1
| | | | add also a test case for this
* solver: do not disqualify already disqualified packagesNatanael Copa2013-07-171-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
* solver: use ffs (posix) instead of ffsl (gnu extension)Timo Teräs2013-07-041-1/+2
| | | | for musl compatibility
* solver: fix pinning+cache to workTimo Teräs2013-06-201-16/+27
| | | | | Mistakenly allowed masked out package to be installed if it was in cache.
* solver: fix package deletion to consier provides properlyTimo Teräs2013-06-191-22/+36
|
* solver: properly order deletion of unneeded packagesTimo Teräs2013-06-191-71/+129
|
* solver: add logic: transitive provides exclusionTimo Teräs2013-06-191-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.
* upgrade: new option: --latest (-l)Timo Teräs2013-06-191-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.
* errors: improve analysis for virtual packagesTimo Teräs2013-06-181-6/+4
| | | | | if all packages named N provide the virtual package, list only the name N instead of all packages providing it.
* db: refactor repository file constructionTimo Teräs2013-06-171-1/+1
| | | | | Fixes also 'fetch' applet to prefer copying/linking to files from cache if possible.
* solver: use array_foreach_item and clean upsTimo Teräs2013-06-141-156/+130
|
* errors: rewrite the logic how errors are reportedTimo Teräs2013-06-131-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.
* solver: prune broken world dependencies with --forceTimo Teräs2013-06-131-22/+54
| | | | mostly useful for reboot, when all packages are not available.
* solver: corner case fixesTimo Teräs2013-06-131-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
* solver: rewrite as deductive solver -- pinning supportTimo Teräs2013-06-131-26/+135
| | | | Fix also pinning test cases to be more sane.
* solver: rewrite as deductive solver -- per name flagsTimo Teräs2013-06-131-8/+24
| | | | | Handle properly per-name preference flags, and add test cases for testing those via fix applet.
* solver: rewrite as deductive solver -- core featuresTimo Teräs2013-06-131-1830/+418
| | | | | Implementing basic dependency handling, install_if and awareness of pinning.
* Revert "Revert "solver: increase score fields to 32-bits (from 16-bits)""William Pitcock2013-06-121-21/+27
| | | | This reverts commit a2d873a77c6dd2e7f6219e6941af796e1f904e69.
* Revert "solver: increase score fields to 32-bits (from 16-bits)"root2013-06-111-27/+21
| | | | This reverts commit 84bfef1a6b587a7da7d12fb701ab0d1d5d6ce2a9.
* db: unify handling of special packagesTimo Teräs2013-05-301-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.
* solver: increase score fields to 32-bits (from 16-bits)Timo Teräs2013-04-291-21/+27
| | | | | We are having so many packages that they might overflow otherwise. "ERROR: Preference overflow" was already reported.
* solver: remove backjumping by nameTimo Teräs2013-01-281-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.
* solver: reintroduce minimum penalty logicTimo Teräs2013-01-281-49/+55
| | | | Basic per-name per-package specific scoring added.
* solver: do not backtrack over "exclude none"Timo Teräs2013-01-221-1/+8
| | | | | Otherwise we can return no solution at all instead of partially satisfied solution (and give proper error message).
* solver: simplify strength evaluation in constraint handlingTimo Teräs2013-01-211-20/+8
|
* solver: check if solution is not found at allTimo Teräs2013-01-211-0/+6
| | | | This is an internal error.
* solver: fix reset of last_touched to zeroTimo Teräs2013-01-181-2/+2
|
* solver: some code clean upsTimo Teräs2013-01-181-5/+5
|
* solver: build fix for debug print on x86_64Natanael Copa2013-01-181-1/+1
| | | | use %zu for size_t
* solver: fix name assignment logic to not mess up internal stateTimo Teräs2013-01-181-11/+10
| | | | | Should get rid of error messages like: ERROR: Saved_score {4/0/0,74} != score {6/0/0,74}
* solver: fix package prefence calculation a bitTimo Teräs2012-11-041-1/+3
|
* solver: additional backjumping schemeTimo Teräs2012-10-081-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.
* solver: optimize backjumpingTimo Teräs2012-10-081-7/+7
| | | | to be functional when backtracking
* solver: properly calculate decision "strength" with providesTimo Teräs2012-10-081-17/+13
|
* solver: fix back jumping once moreTimo Teräs2012-10-051-17/+33
|
* solver: record dependency apk_name in apk_decisionTimo Teräs2012-10-051-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.