makepkg: fix initialization when extracting arrays
Assuming that everything is a string leads to code which is effectively: a= a+=('bar') This creates an array with 2 elements instead of one. Using proper array initialization fixes this. https://lists.archlinux.org/pipermail/pacman-dev/2018-June/022591.html Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
5cf6f614eb
commit
a92a36070a
1 changed files with 5 additions and 1 deletions
|
@ -106,7 +106,11 @@ get_pkgbuild_attribute() {
|
|||
|
||||
local pkgname=$1 attrname=$2 isarray=$3 outputvar=$4
|
||||
|
||||
if (( isarray )); then
|
||||
eval "$outputvar=()"
|
||||
else
|
||||
printf -v "$outputvar" %s ''
|
||||
fi
|
||||
|
||||
if [[ $pkgname ]]; then
|
||||
extract_global_variable "$attrname" "$isarray" "$outputvar"
|
||||
|
|
Loading…
Add table
Reference in a new issue