1 |
On Tuesday, September 13, 2011 19:08:09 Brian Harring wrote: |
2 |
> Making it overridable seems wiser- |
3 |
> |
4 |
> usex() { |
5 |
> local flag="$1" |
6 |
> local tval=${2-yes} |
7 |
> local fval=${3-no} |
8 |
> if use $flag; then |
9 |
> echo "${tval}" |
10 |
> else |
11 |
> echo "${fval}" |
12 |
> fi |
13 |
> } |
14 |
|
15 |
i dont get it. mine already does exactly this, just in one line. |
16 |
usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; } |
17 |
|
18 |
> While a bit longer, we likely can gut most of the use_* logic to |
19 |
> use that, and it makes it easier to deal w/ the situations where a |
20 |
> configure's options always assume --enable-blah thus don't export the |
21 |
> option, but *do* export a --disable-blah. |
22 |
|
23 |
yeah, i thought about replacing use_{with,enable} with usex, but we'd have to |
24 |
extend usex() a little bit more |
25 |
-mike |