From 3179db108a83104d9de6d1d607f55f8118e92160 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 21 Apr 2021 22:47:13 +1000 Subject: Add support for multiple 'Architecture' values This allows architecture to be multivalued. On x86-64 machines, this could be something like: Architecture = x86-64-v3 x86-64 We use the first specified Architecture value in mirrorlist $arch variable replacement, as this is backwards-compatible and sane. Original-patch-by: Dan McGee Patch-updated-by: Allan McRae Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'lib/libalpm/alpm.h') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 833df829..2e99d4d8 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -2016,25 +2016,37 @@ int alpm_option_remove_assumeinstalled(alpm_handle_t *handle, const alpm_depend_ /** @} */ -/** @name Accessors for the configured architecture - * - * libalpm will only install packages that match the configured architecture. - * The architecture does not need to match the physical architecture. - * It can just be treated as a label. +/** @name Accessors to the list of allowed architectures. + * libalpm will only install packages that match one of the configured + * architectures. The architectures do not need to match the physical + architecture. They can just be treated as a label. * @{ */ /** Returns the allowed package architecture. * @param handle the context handle - * @return the configured package architecture + * @return the configured package architectures */ -const char *alpm_option_get_arch(alpm_handle_t *handle); +alpm_list_t *alpm_option_get_architectures(alpm_handle_t *handle); -/** Sets the allowed package architecture. +/** Adds an allowed package architecture. * @param handle the context handle * @param arch the architecture to set */ -int alpm_option_set_arch(alpm_handle_t *handle, const char *arch); +int alpm_option_add_architecture(alpm_handle_t *handle, const char *arch); + +/** Sets the allowed package architecture. + * @param handle the context handle + * @param arches the architecture to set + */ +int alpm_option_set_architectures(alpm_handle_t *handle, alpm_list_t *arches); + +/** Removes an allowed package architecture. + * @param handle the context handle + * @param arch the architecture to remove + */ +int alpm_option_remove_architecture(alpm_handle_t *handle, const char *arch); + /* End of arch accessors */ /** @} */ -- cgit v1.2.3-70-g09d2