FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 02-02-2011, 11:30 PM
Dan McGee
 
Default makepkg bash-3.2 issue

On Wed, Feb 2, 2011 at 6:33 PM, Allan McRae <allan@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
 
Old 02-02-2011, 11:33 PM
Allan McRae
 
Default makepkg bash-3.2 issue

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?

Allan
 

Thread Tools




All times are GMT. The time now is 07:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org