From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.77) (envelope-from ) id 1SqNTs-0006a9-RW for garchives@archives.gentoo.org; Sun, 15 Jul 2012 11:59:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB6BAE04CB; Sun, 15 Jul 2012 11:59:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7E950E04CB for ; Sun, 15 Jul 2012 11:59:13 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B2C541B401A for ; Sun, 15 Jul 2012 11:59:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 9D8DEE5434 for ; Sun, 15 Jul 2012 11:59:10 +0000 (UTC) From: "Ben de Groot" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ben de Groot" Message-ID: <1342353528.52e9002e475557e2c2b42a020f3d0b3ad80b0fd4.yngwin@gentoo> Subject: [gentoo-commits] proj/qt:master commit in: eclass/ X-VCS-Repository: proj/qt X-VCS-Files: eclass/l10n.eclass X-VCS-Directories: eclass/ X-VCS-Committer: yngwin X-VCS-Committer-Name: Ben de Groot X-VCS-Revision: 52e9002e475557e2c2b42a020f3d0b3ad80b0fd4 X-VCS-Branch: master Date: Sun, 15 Jul 2012 11:59:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 411d6a96-026b-4def-a4ac-9a18d1f131f7 X-Archives-Hash: cbdea8685ec5229c8d8a7b82dbe34379 commit: 52e9002e475557e2c2b42a020f3d0b3ad80b0fd4 Author: Ben de Groot gmail com> AuthorDate: Sun Jul 15 11:58:48 2012 +0000 Commit: Ben de Groot gentoo org> CommitDate: Sun Jul 15 11:58:48 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/qt.git;a=3Dco= mmit;h=3D52e9002e l10n.eclass: return instead of export, and allow arguments to be passed --- eclass/l10n.eclass | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass index fd278d2..f2918f3 100644 --- a/eclass/l10n.eclass +++ b/eclass/l10n.eclass @@ -40,15 +40,16 @@ # @DESCRIPTION: # Convenience function for processing localizations. The parameter shoul= d # be a function (defined in the consuming eclass or ebuild) which takes -# an individual localization as parameter. +# an individual localization as (last) parameter. # # Example: l10n_for_each_locale_do install_locale l10n_for_each_locale_do() { - l10n_get_linguas_crosssection - if [[ -n "${L10N_LOCS}" ]]; then + local xlocs=3D + xlocs=3D$(l10n_get_linguas_crosssection) + if [[ -n "${xlocs}" ]]; then local x - for x in ${L10N_LOCS}; do - ${1} ${x} || die "failed to process ${x} locale" + for x in ${xlocs}; do + ${@} ${x} || die "failed to process ${x} locale" done fi } @@ -66,7 +67,7 @@ l10n_for_each_unselected_locale_do() { einfo "Unselected locales are: ${o}" if [[ -n "${o}" ]]; then for x in ${o}; do - ${1} ${x} || die "failed to process unselected ${x} locale" + ${@} ${x} || die "failed to process unselected ${x} locale" done fi } @@ -99,19 +100,17 @@ l10n_find_plocales_changes() { # @FUNCTION: l10n_get_linguas_crosssection # @DESCRIPTION: # Determine the cross-section of user-set LINGUAS and the locales which -# the package offers (listed in PLOCALES), and export L10N_LOCS. In case -# no locales are selected, fall back on PLOCALE_BACKUP. This function is +# the package offers (listed in PLOCALES), and return them. In case no +# locales are selected, fall back on PLOCALE_BACKUP. This function is # normally used internally in this eclass, not by l10n.eclass consumers. l10n_get_linguas_crosssection() { - # @VARIABLE: L10N_LOCS - # @DESCRIPTION: Selected locales (cross-section of LINGUAS and PLOCALES= ) - unset L10N_LOCS local lang=3D loc=3D xloc=3D for lang in ${LINGUAS}; do for loc in ${PLOCALES}; do [[ ${lang} =3D=3D ${loc} ]] && xloc+=3D"${loc} " done done - export L10N_LOCS=3D"${xloc:-$PLOCALE_BACKUP}" - einfo "Selected locales are: ${L10N_LOCS}" + xloc=3D${xloc:-$PLOCALE_BACKUP} + printf "%s" "${xloc}" +# einfo "Selected locales are: ${xloc:-none}" }