Detect repeated values in the arch array

Repeated values in the arch array can result in architecture specific
fields being repeated when using --printsrcinfo.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2025-01-14 18:35:03 +10:00
parent e65b7d421c
commit e767cf9a54

View file

@ -58,6 +58,11 @@ validate_arch() {
fi
done
fi
if (( ${#arch[@]} != $(printf "%s\n" ${arch[@]} | sort -u | wc -l) )); then
error "$(gettext "%s can not contain duplicate values")" 'arch'
ret=1
fi
}
lint_arch() {