Gentoo Archives: gentoo-dev

From: Ben de Groot <yngwin@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: l10n.eclass
Date: Mon, 23 Jul 2012 12:31:54
Message-Id: CAB9SyzSB1_HqaM_hBDiM=2HCdZ51aKcHN+xM_R0Ww5nZGNai8g@mail.gmail.com
In Reply to: Re: [gentoo-dev] RFC: l10n.eclass by Ralph Sennhauser
1 On 20 July 2012 15:33, Ralph Sennhauser <sera@g.o> wrote:
2 > On Thu, 19 Jul 2012 23:37:32 +0800
3 > Ben de Groot <yngwin@g.o> wrote:
4 >
5 >> I got a few more suggestions on IRC, and I have updated the eclass
6 >> accordingly. Please check the attached new version, also available at
7 >> https://gitorious.org/gentoo-qt/qt/blobs/master/eclass/l10n.eclass
8 >
9 > Pseudo inlining
10 >
11 >> # Add linguas useflags
12 >> if [[ -n "${PLOCALES}" ]]; then
13 >> for u in ${PLOCALES}; do
14 >> IUSE+=" linguas_${u}"
15 >> done
16 >> fi
17 >
18 > no need to guard the loop against empty $PLOCALES.
19 >
20 >> l10n_for_each_locale_do() {
21 >> local locs x
22 >> locs=$(l10n_get_locales)
23 >> if [[ -n "${locs}" ]]; then
24 >> for x in ${locs}; do
25 >> ${@} ${x} || die "failed to process enabled
26 >> ${x} locale" done
27 >> fi
28 >> }
29 >
30 > same here, no guarding required and "${@}" should be quoted as it may
31 > contain args with spaces. Also in l10n_for_each_disabled_locale_do.
32
33 Okay, I will make those changes.
34
35 >> # ones. This function is normally used internally in this eclass, not
36 >> by # l10n.eclass consumers.
37 >> l10n_get_locales() {
38 >
39 > I'd mark this function @INTERNAL then, at least until someone can
40 > presents a use case.
41 > If you are sufficiently sure this function shouldn't be used by
42 > consumers you could remove the function
43
44 There are use cases, e.g. net-im/qtwitter-0.10.0-r1 for which I have
45 an editted -r10 revision in my dev overlay. I'm sure it could be handled
46 with l10n_for_each_locale_do, but the migration is more straight-forward
47 by simply using l10n_get_locales in this case.
48
49 This is why I worded it "normally" instead of "only". Maybe the wording
50 could be improved?
51
52 --
53 Cheers,
54
55 Ben | yngwin
56 Gentoo developer
57 Gentoo Qt project lead, Gentoo Wiki admin

Replies

Subject Author
Re: [gentoo-dev] RFC: l10n.eclass Ralph Sennhauser <sera@g.o>