pacman/lib/libalpm/sync.h

33 lines
1.3 KiB
C
Raw Normal View History

2005-03-15 01:51:43 +00:00
/*
* sync.h
*
* Copyright (c) 2006-2022 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
*
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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2005-03-15 01:51:43 +00:00
*/
#ifndef ALPM_SYNC_H
#define ALPM_SYNC_H
2005-03-15 01:51:43 +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);
int _alpm_sync_load(alpm_handle_t *handle, alpm_list_t **data);
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
#endif /* ALPM_SYNC_H */