2005-03-15 01:51:43 +00:00
|
|
|
/*
|
|
|
|
* sync.h
|
2007-11-16 20:18:45 -06:00
|
|
|
*
|
2022-01-02 13:34:52 +10:00
|
|
|
* Copyright (c) 2006-2022 Pacman Development Team <pacman-dev@lists.archlinux.org>
|
2009-07-01 02:08:33 -05:00
|
|
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
2006-10-15 19:31:03 +00:00
|
|
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
|
|
|
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
2007-11-16 20:18:45 -06:00
|
|
|
*
|
2005-03-15 01:51:43 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-12-10 22:55:22 -06:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-03-15 01:51:43 +00:00
|
|
|
*/
|
2016-09-03 22:14:49 -05:00
|
|
|
#ifndef ALPM_SYNC_H
|
|
|
|
#define ALPM_SYNC_H
|
2005-03-15 01:51:43 +00:00
|
|
|
|
2006-11-20 09:10:23 +00:00
|
|
|
#include "alpm.h"
|
2005-03-15 01:51:43 +00:00
|
|
|
|
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-16 16:36:56 +00:00
|
|
|
int _alpm_sync_prepare(alpm_handle_t *handle, alpm_depstrategy_t depstrategy, alpm_list_t **data);
|
2014-10-11 04:08:20 -04:00
|
|
|
int _alpm_sync_load(alpm_handle_t *handle, alpm_list_t **data);
|
2015-09-14 18:37:40 -04:00
|
|
|
int _alpm_sync_check(alpm_handle_t *handle, alpm_list_t **data);
|
|
|
|
int _alpm_sync_commit(alpm_handle_t *handle);
|
2005-03-15 01:51:43 +00:00
|
|
|
|
2016-09-03 22:14:49 -05:00
|
|
|
#endif /* ALPM_SYNC_H */
|