mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 09:51:50 -05:00
makepkg: disallow values of 'arch' which might be problematic
We rely on values in the arch array to be valid as part of variable names, so extend the arch lint check to catch this. This also cleans up lint_arch to restrict the use of "lint" only to the package-specific architecture checks. It previously had an odd declaration with a conditional expansion that would never be true.
This commit is contained in:
parent
85c055da73
commit
9c066dff43
@ -2359,13 +2359,21 @@ lint_epoch() {
|
||||
}
|
||||
|
||||
lint_arch() {
|
||||
local name list=("${@:-"${arch[@]}"}")
|
||||
local a name list
|
||||
|
||||
if [[ $list == 'any' ]]; then
|
||||
if [[ $arch == 'any' ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! in_array "$CARCH" "${list[@]}" && (( ! IGNOREARCH )); then
|
||||
for a in "${arch[@]}"; do
|
||||
if [[ $a = *[![:alnum:]_]* ]]; then
|
||||
error "$(gettext "%s contains invalid characters: '%s'")" \
|
||||
'arch' "${a//[[:alnum:]_]}"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
if (( ! IGNOREARCH )) && ! in_array "$CARCH" "${arch[@]}"; then
|
||||
error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgbase" "$CARCH"
|
||||
plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
|
||||
plain "$(gettext "such as %s.")" "arch=('$CARCH')"
|
||||
|
Loading…
x
Reference in New Issue
Block a user