On Thu, 19 Jul 2012 23:37:32 +0800 Ben de Groot <yng...@gentoo.org> 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. > # 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 in favour of 'use linguas_${x} || continue' in l10n_for_each_locale_do resp 'use linguas_${x} && continue' in l10n_for_each_disabled_locale_do.
signature.asc
Description: PGP signature