Gentoo Archives: gentoo-dev

From: Donnie Berkholz <dberkholz@g.o>
To: Mike Frysinger <vapier@g.o>
Cc: gentoo-dev@l.g.o, hanno@g.o
Subject: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in app-doc/gimp-help: ChangeLog gimp-help-0.13.ebuild
Date: Wed, 26 Sep 2007 08:56:12
Message-Id: 20070926084242.GM22279@supernova
In Reply to: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in app-doc/gimp-help: ChangeLog gimp-help-0.13.ebuild by Mike Frysinger
1 On 04:36 Wed 26 Sep , Mike Frysinger wrote:
2 > On Wednesday 26 September 2007, Donnie Berkholz wrote:
3 > > I might define a custom function here to reduce duplication and increase
4 > > readability.
5 > >
6 > > use_linguas() {
7 > > local lingua=$1
8 > > use linguas_${lingua} && ALL_LINGUAS="${ALL_LINGUAS} ${lingua}"
9 > > }
10 > >
11 > > And then..
12 > >
13 > > use_linguas de
14 > > use_linguas en
15 > > ...
16 >
17 > nice ... and to take it a step further:
18 > for l in de en ... ; do use_linguas ${l} ; done
19
20 And a step farther than that... =)
21
22 for USE in ${IUSE}; do
23 [[ ${USE} = linguas_* ]] && use_linguas ${USE}
24 done
25
26 with a slightly different definition of use_linguas(). The benefit of
27 this is that you only need to define the available languages in one
28 place, so you don't need to worry about them getting out of sync. It
29 would be a little more elegant if you had IUSE_LINGUAS, which was then
30 included in IUSE, so you didn't need to do that test.
31
32 Thanks,
33 Donnie
34 --
35 gentoo-dev@g.o mailing list

Replies