aboutsummaryrefslogtreecommitdiffstats
path: root/src/solver.c
Commit message (Collapse)AuthorAgeFilesLines
* upgrade: implement --ignore to exclude some packages from upgradenrybowski2019-12-121-2/+4
|
* solver: fix common dependency merging to inherit pinning and flagsTimo Teräs2019-06-051-3/+7
| | | | | | Notably this fixes occasional issues when doing upgrade with multiple versions of same packages. Without this the upgrade flag is not always propagated properly down the dependency chain.
* fix orphan package handling for certain provides casesTimo Teräs2018-11-121-15/+17
|
* prefer selecting packages by their primary nameTimo Teräs2018-11-121-8/+16
|
* fix package preference based on it's conflicts in --latest modeTimo Teräs2018-11-121-4/+5
| | | | remove also redundant pkg_selectable check in repair mode.
* fetch: ignore conflicts when solving --recursive fetchesTimo Teräs2018-06-141-8/+23
|
* solver: allow names with only one provider to be autoselected regardless of ↵William Pitcock2018-02-211-2/+3
| | | | priority
* split --force to several --force-[type] optionsTimo Teräs2018-01-031-1/+1
| | | | | | | | | This unloads --force as several of the things are really not wanted together. E.g. --force-refresh is a lot different from --force-broken-world and doing --force to get the other might introduce unwanted behaviour. --force is still kept for backwards compatibility and it enables most things --force was used for.
* solver: fix potential install_if processing failure, fixes #8237Timo Teräs2017-12-121-46/+49
| | | | | | | | | In discovery phase, there was logic to not process packages multiple times. However, that logic failed to account the package's depth and install_if state for the name being processed. This caused install_if processing failure in certain topologies of the dependency graph. Adds also a test case that should catch this issue reliably.
* solver: prefer highest requirer count above installed statusWilliam Pitcock2017-11-021-5/+5
| | | | | This ensures a swap is emitted when replacing a virtual with apk add.
* solver: fix dbg_printf() call in select_package()William Pitcock2017-11-021-2/+2
|
* solver: only select a default if there is at least one provider with a ↵William Pitcock2017-11-021-0/+6
| | | | declared provider_priority
* solver: instead of tracking selected packages, score by requirer count for ↵William Pitcock2017-11-021-6/+13
| | | | tiebreaking
* solver: implement support for choosing default virtualsWilliam Pitcock2017-11-021-7/+17
| | | | | | | | | | By introducing a new package metadata field, `provider_priority` (index letter `k`), we can specify default packages to satisfy a virtual. If a user wishes to select an alternative provider for the virtual, a changeset swapping the default provider for the selected provider will be generated by the dependency resolver.
* solver: consider virtual provides to exclude non-provides transitivelyTimo Teräs2017-10-271-12/+19
| | | | | | | | | | | this fixes package selection when a 'real' package exists, but would need to be provided by another package with 'virtual provides'. In current package database this can happen with postgresql which is also provided by postgresql-bdr. Normally postgresql would be satisfied by postgresql, but if any package depends on postgresql-bdr and there's no versioned dependency on postgresql this will help apk figure out that postgresql-bdr should be used.
* 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.