[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev]  Re: Re: [gentoo-commits] gentoo-x86 commit in app-doc/gimp-help: ChangeLog gimp-help-0
From:       Steve Long <slong () rathaus ! eclipse ! co ! uk>
Date:       2007-09-27 15:30:45
Message-ID: fdgi3h$3g9$1 () sea ! gmane ! org
[Download RAW message or body]

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.


-- 
gentoo-dev@gentoo.org mailing list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic