pacman/lib/libalpm
Ed Smith 184346129a
Add an alternative dependency resolution algorithm
The existing dependency resolution, as implemented in resolvedep(),
prioritises name matches for a dependency over packages that only
provide that dependency. We would like the option to prioritise
database ordering above a precise name match.

To do this, we add a DependencyStrategy configuration parameter. The
default is to behave as pacman currently does, with
DependencyStrategy=Default.  However, we also add a Strict strategy
(to strictly honour the priorities of repositories) which matches our
desired behaviour in some circumstances.

For the sake of clarity, the default strategy will:

- take the package with the exact name given from the highest priority
  repository, ignoring all other packages.

- if this doesn't exist, take an installed package providing this
  name, ignoring all other packages.

- otherwise, it will give a list of packages that provide this name,
  in repository priority order, accumulated from every repository.

In contrast, the strict strategy will:

- take an installed package providing the dependency name, ignoring
  all other packages.

- otherwise, give a list of all packages that either have this name,
  or provide this name, accumulated from every repository. The
  ordering is by repository priority order, with packages having the
  exact name being first among the packages from their repository.

When does this difference matter? Let's suppose we have two repositories,

- customizations
- base

Let's say we have a list of instructions that involve installing the
name foo, which is provided by customizations/foo-customized. One day,
base/foo comes into existence. Under the default strategy, our
instructions now no longer install customizations/foo-customized,
meaning our instructions no longer install our customized version of
foo. Under the strict strategy, our instructions will now either
prompt for the correct package to install, or because the default will
be correct, will simply install the correct package with --noconfirm.

Signed-off-by: Ed Smith <ed.smith@collabora.com>
2024-01-31 15:37:29 +00:00
..
po Fix remaining email list address 2022-06-25 22:59:20 +10:00
.gitignore libalpm: add pkg-config file 2012-04-25 20:02:36 -04:00
add.c add.c: drop newline in permission and ownership log messages 2024-01-10 08:52:35 +10:00
add.h Update copyright years 2022-01-02 13:34:52 +10:00
alpm.c _alpm_handle_free: free all in-memory resources 2024-01-09 22:39:14 +00:00
alpm.h Add an alternative dependency resolution algorithm 2024-01-31 15:37:29 +00:00
alpm_list.c Update copyright years 2022-01-02 13:34:52 +10:00
alpm_list.h Update copyright years 2022-01-02 13:34:52 +10:00
backup.c Update copyright years 2022-01-02 13:34:52 +10:00
backup.h Update copyright years 2022-01-02 13:34:52 +10:00
base64.c base64.c: comment out unused variable 2014-01-15 15:54:56 +10:00
base64.h Do not #define _RESERVED_IDENTIFIERS 2016-09-25 18:04:57 +10:00
be_local.c add extended data field for arbitrary package data 2022-07-21 19:01:27 +10:00
be_package.c _alpm_pkg_load_internal: prevent double closing file descriptor 2022-12-13 10:00:13 +10:00
be_sync.c add extended data field for arbitrary package data 2022-07-21 19:01:27 +10:00
conflict.c pacman+libalpm: print version names for conflicting packages 2023-09-05 01:57:01 +00:00
conflict.h Update copyright years 2022-01-02 13:34:52 +10:00
db.c db.c: set pm_errno for server list modifications 2023-12-02 04:56:25 +00:00
db.h alpm: add cache server support 2023-12-02 04:56:25 +00:00
deps.c Add an alternative dependency resolution algorithm 2024-01-31 15:37:29 +00:00
deps.h Add an alternative dependency resolution algorithm 2024-01-31 15:37:29 +00:00
diskspace.c Update copyright years 2022-01-02 13:34:52 +10:00
diskspace.h Update copyright years 2022-01-02 13:34:52 +10:00
dload.c alpm: add cache server support 2023-12-02 04:56:25 +00:00
dload.h alpm: add cache server support 2023-12-02 04:56:25 +00:00
error.c Update copyright years 2022-01-02 13:34:52 +10:00
filelist.c libalpm: mark filelist_contains as taking a const filelist 2022-03-06 17:32:23 +10:00
filelist.h Update copyright years 2022-01-02 13:34:52 +10:00
graph.c Update copyright years 2022-01-02 13:34:52 +10:00
graph.h Update copyright years 2022-01-02 13:34:52 +10:00
group.c Update copyright years 2022-01-02 13:34:52 +10:00
group.h Update copyright years 2022-01-02 13:34:52 +10:00
handle.c _alpm_handle_free: free all in-memory resources 2024-01-09 22:39:14 +00:00
handle.h Update copyright years 2022-01-02 13:34:52 +10:00
hook.c Update copyright years 2022-01-02 13:34:52 +10:00
hook.h Update copyright years 2022-01-02 13:34:52 +10:00
libarchive-compat.h Update copyright years 2022-01-02 13:34:52 +10:00
log.c Update copyright years 2022-01-02 13:34:52 +10:00
log.h Update copyright years 2022-01-02 13:34:52 +10:00
meson.build Remove support for deltas from libalpm 2019-03-07 11:12:12 +10:00
package.c add extended data field for arbitrary package data 2022-07-21 19:01:27 +10:00
package.h add extended data field for arbitrary package data 2022-07-21 19:01:27 +10:00
pkghash.c Update copyright years 2022-01-02 13:34:52 +10:00
pkghash.h Update copyright years 2022-01-02 13:34:52 +10:00
rawstr.c Remove all modelines from the project 2018-05-14 09:59:15 +10:00
remove.c Update copyright years 2022-01-02 13:34:52 +10:00
remove.h Update copyright years 2022-01-02 13:34:52 +10:00
signing.c Fix segfault when failing to import keys 2022-03-06 20:36:59 +10:00
signing.h Update copyright years 2022-01-02 13:34:52 +10:00
sync.c Add an alternative dependency resolution algorithm 2024-01-31 15:37:29 +00:00
sync.h Add an alternative dependency resolution algorithm 2024-01-31 15:37:29 +00:00
trans.c Add an alternative dependency resolution algorithm 2024-01-31 15:37:29 +00:00
trans.h Update copyright years 2022-01-02 13:34:52 +10:00
util.c free handle resources before running scripts 2024-01-09 22:39:14 +00:00
util.h Update copyright years 2022-01-02 13:34:52 +10:00
version.c Update copyright years 2022-01-02 13:34:52 +10:00