1 |
On Wednesday 26 September 2007, Donnie Berkholz wrote: |
2 |
> On 04:36 Wed 26 Sep , Mike Frysinger wrote: |
3 |
> > On Wednesday 26 September 2007, Donnie Berkholz wrote: |
4 |
> > > I might define a custom function here to reduce duplication and |
5 |
> > > increase readability. |
6 |
> > > |
7 |
> > > use_linguas() { |
8 |
> > > local lingua=$1 |
9 |
> > > use linguas_${lingua} && ALL_LINGUAS="${ALL_LINGUAS} ${lingua}" |
10 |
> > > } |
11 |
> > > |
12 |
> > > And then.. |
13 |
> > > |
14 |
> > > use_linguas de |
15 |
> > > use_linguas en |
16 |
> > > ... |
17 |
> > |
18 |
> > nice ... and to take it a step further: |
19 |
> > for l in de en ... ; do use_linguas ${l} ; done |
20 |
> |
21 |
> And a step farther than that... =) |
22 |
|
23 |
even nicer |
24 |
|
25 |
> for USE in ${IUSE}; do |
26 |
> [[ ${USE} = linguas_* ]] && use_linguas ${USE} |
27 |
> done |
28 |
|
29 |
you dont want to use the variable 'USE' ... while it would work correctly if |
30 |
you declared it with 'local', it'd be confusing and repoman may just barf on |
31 |
it ($USE is supposed to be readonly for ebuilds) |
32 |
-mike |