index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2021-04-21 22:47:13 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2021-04-22 00:15:21 +1000 |
commit | 3179db108a83104d9de6d1d607f55f8118e92160 (patch) | |
tree | 2141a5a0a565bbfc8261bbc434bcfa53830115a1 /lib/libalpm/trans.c | |
parent | abdb4d7fa699ae3b8ff09ba79656f6853b9a1357 (diff) |
-rw-r--r-- | lib/libalpm/trans.c | 21 |
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; |