1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-02-28 09:21:53 -05:00

libmakepkg: look for architecture-specific hashes in get_integlist

`makepkg -g` looks for existing checksums in the PKGBUILD file, so that
it can generate new sums of the same type. Previously it only checked
variables of the form "sha256sums", and not "sha256sums_x86_64". That
meant it would always fall back to MD5 for packages with only
architecture-specific sources. This change makes it look at
architecture-specific checksums too to determine the type.

Signed-off-by: Jack O'Connor <oconnor663@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Jack O'Connor 2016-08-01 13:06:00 +10:00 committed by Allan McRae
parent 5b839c58ee
commit 56de155296

View File

@ -195,10 +195,21 @@ get_integlist() {
local integlist=() local integlist=()
for integ in "${known_hash_algos[@]}"; do for integ in "${known_hash_algos[@]}"; do
# check for e.g. "sha256sums"
local sumname="${integ}sums[@]" local sumname="${integ}sums[@]"
if [[ -n ${!sumname} ]]; then if [[ -n ${!sumname} ]]; then
integlist+=("$integ") integlist+=("$integ")
continue
fi fi
# check for e.g. "sha256sums_x86_64"
for a in "${arch[@]}"; do
local sumname="${integ}sums_${a}[@]"
if [[ -n ${!sumname} ]]; then
integlist+=("$integ")
break
fi
done
done done
if (( ${#integlist[@]} > 0 )); then if (( ${#integlist[@]} > 0 )); then