openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
132 stars 183 forks source link

Allow the '--buildtool-opt' option to be used multiple times to pass multiple options to the underlying build tool #930

Closed dmach closed 1 year ago

dmach commented 1 year ago

It seems that it works fine with bash 3.1 (AFAIK it's part of SLE10):

$ podman run --rm -it bash:3.1 /usr/local/bin/bash -c 'VAR1=("a" "b"); VAR2=("1" "2"); VAR1+=(${VAR2[@]}); echo "${VAR1[@]}"'
a b 1 2

bash 3.0 doesn't work:

$ podman run --rm -it bash:3.0 /usr/local/bin/bash -c 'VAR1=("a" "b"); VAR2=("1" "2"); VAR1+=(${VAR2[@]}); echo "${VAR1[@]}"'
/usr/local/bin/bash: -c: line 0: syntax error near unexpected token `${VAR2[@]}'
/usr/local/bin/bash: -c: line 0: `VAR1=("a" "b"); VAR2=("1" "2"); VAR1+=(${VAR2[@]}); echo "${VAR1[@]}"'
dmach commented 1 year ago

Force-pushed with a code that avoids using += on arrays.