1 |
Donnie Berkholz wrote: |
2 |
|
3 |
> On 05:14 Wed 26 Sep , Mike Frysinger wrote: |
4 |
>> if it's all common shell, it's pretty hard to hide ... you could try some |
5 |
>> tricks like rewriting USE to __USE__ so internal code (like the `use` |
6 |
>> function) still work, but in the end, does that really help ? |
7 |
> |
8 |
> I think so. It explicitly says that's private and not part of the API, |
9 |
> and it makes accidental overwrites much more unlikely. |
10 |
> |
11 |
Yeah but if it's been declare'd -r (readonly) that isn't an issue. |
12 |
|
13 |
Personally I think access to all the variables is fine; an ebuild is a |
14 |
shell-script, not a C++ project, and if a dev breaks something it's his |
15 |
responsibility to fix it. (Quite apart from this review process picking |
16 |
stuff up.) My 2c on that. |
17 |
|
18 |
Wrt to the function, I'd define it so: |
19 |
|
20 |
use_linguas() { |
21 |
(($#)) || die 'use_linguas() called with no arguments' |
22 |
ALL_LINGUAS= |
23 |
local lingua |
24 |
for lingua; do |
25 |
use "linguas_$lingua" && ALL_LINGUAS+=" $lingua" |
26 |
done |
27 |
# [[ $ALL_LINGUAS ]] || die 'No Linguas available' |
28 |
[[ $ALL_LINGUAS ]] && return 0 |
29 |
# ALL_LINGUAS=en # default to English |
30 |
return 1 |
31 |
} |
32 |
..to call with use_linguas de en es it zh # for example |
33 |
|
34 |
It'd be easier to maintain if the ebuild author wrote: |
35 |
MY_LINGUAS='de en es it zh' |
36 |
..at the top of the file, with calls to: |
37 |
use_linguas $MY_LINGUAS |
38 |
..where needed. |
39 |
|
40 |
|
41 |
-- |
42 |
gentoo-dev@g.o mailing list |