summaryrefslogtreecommitdiff
path: root/src/solver.c
AgeCommit message (Collapse)AuthorFilesLines
2023-04-11db, apps: sort display results based on package namesTimo Teräs1-1/+1
2022-12-25solver: prioritize user specified action on mentioned packagesTimo Teräs1-0/+4
Force preference on the user specified action on commandline. This allows upgrading packages which would otherwise be kept back due to partial update preferring to keep top level dependency on the installed version. fixes #7531
2022-12-22solver: move install if discovery after all dependencies are doneTimo Teräs1-7/+10
2022-12-21solver: fix install_if via provides onlyTimo Teräs1-2/+7
fixes #10721
2022-12-20solver: fix queue resolving orderTimo Teräs1-3/+3
It makes sense to not prioritize requirers anymore. It was originally intended to select early packages with multiple constraints seen. However, more important are the constraints that actually limit the choise. fixes #10843
2022-12-20solver, commit: handle install_if via provided names correctlyTimo Teräs1-22/+36
Correctly trigger install_ifs for provided names also. And fix the construction of error messages concerning such install_if packages. ref #10843
2022-02-24solver: do not auto select virtual-only package with one providerTimo Teräs1-2/+2
This reverts most of 0dcbd933 which allowed automatic selection of package with a "virtual provides" having only one provider. While convenient, it creates problems if multiple versions of the same package exist, or if in future other providers would be added to one of the repositories. This restore the original behaviour, and improve the error message to tell the user to mention one of the providers explicitly. fixes #10810
2021-05-20solver: don't consider requirer count for preferenceTimo Teräs1-18/+0
The original intent was to choose packages to which there is most dependencies. However, since the code has evolved this is has been mostly obsolete. And in fact now interferes with the provides and provides priority mechanism. Remove this as obsolete. Fixes #10742
2020-08-24fix, simplify and document upgrade --ignoreTimo Teräs1-4/+5
2020-08-24solver: add more dbg_printfsOliver Smith1-19/+62
2020-05-19make the atom functions not use global stateTimo Teräs1-12/+12
This greatly helps with memory management on applications that may want to daemonize and open/close database several times. Also the lifetime and "owner" of memory for all data is now explicitly bound to owning struct apk_database, which might be helpful when writing language bindings. As side effect, the interned "atoms" are unique only within what apk_database, so comparing packages from different apk_database may not work as expected. Fixes #10697
2020-05-07use SPDX-License-Identifier in source filesTBK1-3/+1
2019-12-12upgrade: implement --ignore to exclude some packages from upgradenrybowski1-2/+4
2019-06-05solver: fix common dependency merging to inherit pinning and flagsTimo Teräs1-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.
2018-11-12fix orphan package handling for certain provides casesTimo Teräs1-15/+17
2018-11-12prefer selecting packages by their primary nameTimo Teräs1-8/+16
2018-11-12fix package preference based on it's conflicts in --latest modeTimo Teräs1-4/+5
remove also redundant pkg_selectable check in repair mode.
2018-06-14fetch: ignore conflicts when solving --recursive fetchesTimo Teräs1-8/+23
2018-02-21solver: allow names with only one provider to be autoselected regardless of ↵William Pitcock1-2/+3
priority
2018-01-03split --force to several --force-[type] optionsTimo Teräs1-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.
2017-12-12solver: fix potential install_if processing failure, fixes #8237Timo Teräs1-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.
2017-11-02solver: prefer highest requirer count above installed statusWilliam Pitcock1-5/+5
This ensures a swap is emitted when replacing a virtual with apk add.
2017-11-02solver: fix dbg_printf() call in select_package()William Pitcock1-2/+2
2017-11-02solver: only select a default if there is at least one provider with a ↵William Pitcock1-0/+6
declared provider_priority
2017-11-02solver: instead of tracking selected packages, score by requirer count for ↵William Pitcock1-6/+13
tiebreaking
2017-11-02solver: implement support for choosing default virtualsWilliam Pitcock1-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.
2017-10-27solver: consider virtual provides to exclude non-provides transitivelyTimo Teräs1-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.
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.