On 20 July 2012 15:33, Ralph Sennhauser <[email protected]> wrote:
> On Thu, 19 Jul 2012 23:37:32 +0800
> Ben de Groot <[email protected]> wrote:
>
>> I got a few more suggestions on IRC, and I have updated the eclass
>> accordingly. Please check the attached new version, also available at
>> https://gitorious.org/gentoo-qt/qt/blobs/master/eclass/l10n.eclass
>
> Pseudo inlining
>
>> # Add linguas useflags
>> if [[ -n "${PLOCALES}" ]]; then
>> for u in ${PLOCALES}; do
>> IUSE+=" linguas_${u}"
>> done
>> fi
>
> no need to guard the loop against empty $PLOCALES.
>
>> l10n_for_each_locale_do() {
>> local locs x
>> locs=$(l10n_get_locales)
>> if [[ -n "${locs}" ]]; then
>> for x in ${locs}; do
>> ${@} ${x} || die "failed to process enabled
>> ${x} locale" done
>> fi
>> }
>
> same here, no guarding required and "${@}" should be quoted as it may
> contain args with spaces. Also in l10n_for_each_disabled_locale_do.
Okay, I will make those changes.
>> # ones. This function is normally used internally in this eclass, not
>> by # l10n.eclass consumers.
>> l10n_get_locales() {
>
> I'd mark this function @INTERNAL then, at least until someone can
> presents a use case.
> If you are sufficiently sure this function shouldn't be used by
> consumers you could remove the function
There are use cases, e.g. net-im/qtwitter-0.10.0-r1 for which I have
an editted -r10 revision in my dev overlay. I'm sure it could be handled
with l10n_for_each_locale_do, but the migration is more straight-forward
by simply using l10n_get_locales in this case.
This is why I worded it "normally" instead of "only". Maybe the wording
could be improved?
--
Cheers,
Ben | yngwin
Gentoo developer
Gentoo Qt project lead, Gentoo Wiki admin