Donnie Berkholz wrote:
> On 05:14 Wed 26 Sep , Mike Frysinger wrote:
>> if it's all common shell, it's pretty hard to hide ... you could try some
>> tricks like rewriting USE to __USE__ so internal code (like the `use`
>> function) still work, but in the end, does that really help ?
>
> I think so. It explicitly says that's private and not part of the API,
> and it makes accidental overwrites much more unlikely.
>
Yeah but if it's been declare'd -r (readonly) that isn't an issue.
Personally I think access to all the variables is fine; an ebuild is a
shell-script, not a C++ project, and if a dev breaks something it's his
responsibility to fix it. (Quite apart from this review process picking
stuff up.) My 2c on that.
Wrt to the function, I'd define it so:
use_linguas() {
(($#)) || die 'use_linguas() called with no arguments'
ALL_LINGUAS=
local lingua
for lingua; do
use "linguas_$lingua" && ALL_LINGUAS+=" $lingua"
done
# [[ $ALL_LINGUAS ]] || die 'No Linguas available'
[[ $ALL_LINGUAS ]] && return 0
# ALL_LINGUAS=en # default to English
return 1
}
..to call with use_linguas de en es it zh # for example
It'd be easier to maintain if the ebuild author wrote:
MY_LINGUAS='de en es it zh'
..at the top of the file, with calls to:
use_linguas $MY_LINGUAS
..where needed.
--
[EMAIL PROTECTED] mailing list