[pacman-dev] makepkg bash-3.2 issue
Dan McGee
dpmcgee at gmail.com
Wed Feb 2 19:30:50 EST 2011
On Wed, Feb 2, 2011 at 6:33 PM, Allan McRae <allan at archlinux.org> wrote:
> Hi,
>
> Can anyone give me a fix for this:
>
>
> local optdepends_list
> eval $(awk '/^[[:space:]]*optdepends=/,/\)/' "$BUILDFILE" | sed
> "s/optdepends=/optdepends_list+=/")
>
> In bash-3.2, this gives optdepends_list with "" as the first item in the
> array. It appears that declaring a local variable in bash-3.2 causes it to
> be given a blank value:
>
> bash-4.1
>> declare optdepends_list
>> echo ${#optdepends_list[@]}
> 0
>
> bash-3.2
>> declare optdepends_list
>> echo ${#optdepends_list[@]}
> 1
>
>
> Anyone know how to work around this?
Did you try `declare -a`?
-Dan
More information about the pacman-dev
mailing list