Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2021-04-21 22:47:13 +1000
committerAllan McRae <allan@archlinux.org>2021-04-22 00:15:21 +1000
commit3179db108a83104d9de6d1d607f55f8118e92160 (patch)
tree2141a5a0a565bbfc8261bbc434bcfa53830115a1 /lib/libalpm/trans.c
parentabdb4d7fa699ae3b8ff09ba79656f6853b9a1357 (diff)
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 <dan@archlinux.org> Patch-updated-by: Allan McRae <allan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index c6ec7eea..939ab05a 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -71,14 +71,29 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs)
alpm_list_t *i;
alpm_list_t *invalid = NULL;
- const char *arch = handle->arch;
- if(!arch) {
+ if(!handle->architectures) {
+ _alpm_log(handle, ALPM_LOG_DEBUG, "skipping architecture checks\n");
return NULL;
}
for(i = pkgs; i; i = i->next) {
alpm_pkg_t *pkg = i->data;
+ alpm_list_t *j;
+ int found = 0;
const char *pkgarch = alpm_pkg_get_arch(pkg);
- if(pkgarch && strcmp(pkgarch, arch) && strcmp(pkgarch, "any")) {
+
+ /* always allow non-architecture packages and those marked "any" */
+ if(!pkgarch || strcmp(pkgarch, "any") == 0) {
+ continue;
+ }
+
+ for(j = handle->architectures; j; j = j->next) {
+ if(strcmp(pkgarch, j->data) == 0) {
+ found = 1;
+ break;
+ }
+ }
+
+ if(!found) {
char *string;
const char *pkgname = pkg->name;
const char *pkgver = pkg->version;