> DIST_EXAMPLES=("a" "b") > perl_doexamples "${DIST_EXAMPLES}" This combination only results in "a" being installed. > DIST_EXAMPLES=("a" "b") > echo ${DIST_EXAMPLES} Only prints "a" > DIST_EXAMPLES=("a c" "b c") > perl -MData::Dumper -E 'say Dumper(\@ARGV)' ${DIST_EXAMPLES[@]} > # $VAR1 = [ > # 'a', > # 'c', > # 'b', > # 'c' > # ]; This evidences lack of quoting turns spaces in tokens into new tokens. > DIST_EXAMPLES=("a c" "b c") > > perl -MData::Dumper -E 'say Dumper(\@ARGV)' "${DIST_EXAMPLES[@]}" > # $VAR1 = [ > # 'a c', > # 'b c' > # ]; I believe this is the behaviour we want. Hence, the line should read: > [[ -z "${DIST_EXAMPLES}" ]] || perl_doexamples "${DIST_EXAMPLES[@]}" But I'm not sure about the '-z' part ;)
commit 65a68e76dbbc3245624c79548dffb617da7885bd Author: Andreas K. Hüttel <dilfridge@gentoo.org> Date: Mon Apr 18 23:05:55 2016 +0200 perl-module.eclass: Fix bash array handling of DIST_EXAMPLES Thanks, fixed. (Also the -z part.)