1 |
On 20:57 Tue 05 Oct , Michał Górny wrote: |
2 |
> # @FUNCTION: use_scons |
3 |
> # @USAGE: <use-flag> [var-name] [var-opt-true] [var-opt-false] |
4 |
> # @DESCRIPTION: |
5 |
> # Output an SCons parameter with value depending on the USE flag state. |
6 |
> # If the USE flag is set, output <var-name>=<var-opt-true>; otherwise |
7 |
> # <var-name>=<var-opt-false>. |
8 |
> # |
9 |
> # If <var-name> is not set, <use-flag> will be used instead. |
10 |
> # If <var-opt-true> or <var-opt-false> is unset, USE_SCONS_TRUE |
11 |
> # or USE_SCONS_FALSE will be used instead. |
12 |
> use_scons() { |
13 |
> local flag=${1} |
14 |
> local varname=${2:-${flag#!}} |
15 |
|
16 |
Could you explain how this works to me, please? It seems like you're |
17 |
reversing the logic when people use the !flag syntax. |
18 |
|
19 |
> local vartrue=${3:-${USE_SCONS_TRUE}} |
20 |
> local varfalse=${4:-${USE_SCONS_FALSE}} |
21 |
|
22 |
-- |
23 |
Thanks, |
24 |
Donnie |
25 |
|
26 |
Donnie Berkholz |
27 |
Sr. Developer, Gentoo Linux |
28 |
Blog: http://dberkholz.wordpress.com |