Re: Troubles in a multiple choice

Stefan Fiedler <[email protected]> Fri, 17 Nov 2006 19:46:30 +0100
Newsgroups gmane.linux.distributions.rock.devel
Message-ID <[email protected]>
On Friday 17 November 2006 19:17, Luca wrote:
> Hi, forgot to add a P.S in the reply.
>
> When I pass the locale list grep command on the console I receive, exampl=
e:
> is_IS.UTF-8
> is_IS
> it_CH.UTF-8
> it_CH
> it_IT.UTF-8
> it_IT
> it_IT@euro
> iw_IL.UTF-8
>
> in the *swp* file:
> 'is_IS.UTF-8'
> 'is_IS'
> 'it_CH.UTF-8'
> 'it_CH'
> 'it_IT.UTF-8'
> 'it_IT'
> 'it_IT@euro'
> 'iw_IL.UTF-8'
>
> but in the choice list only:
> is IS
> it CH
> it IT
>
> and it auto detects and choose by default the <ll_LL>.UTF-8
>
> Friendly,
> Luca

I think you are missing the <desc> arguments for choice:

comment 'Choose your locale:'

=A0 =A0 CFGTEMP_PKG_GLIBC_LANG=3D"POSIX Language_not_set \
`grep "/" $confdir/SUPPORTED | cut -d/ -f1`"

=A0 =A0 choice ROCKCFG_PKG_GLIBC_LANG POSIX $CFGTEMP_PKG_GLIBC_LANG

The following should work (not tested this time):

    CFGTEMP_PKG_GLIBC_LANG=3D`grep "/" package/base/glibc/<subdir>/SUPPORTE=
D | =

while read x ; do echo $x $x ; done`

    choice ROCKCFG_PKG_GLIBC_LANG POSIX \
	POSIX Language_not_set  $CFGTEMP_PKG_GLIBC_LANG

Note there are some subtleties in bash quoting and passing arguments to =

functions, e.g. consider the following example:

# test_func () { for x ; do echo $x ; done ; }
# test_func arg1 'arg2 3'
arg1
arg2 3
# y=3D"arg1 'arg2 3' "
# test_func $y
arg1
'arg2
3'
# eval test_func $y
arg1
arg2 3

Greets,
	Stefan Fiedler