From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1C90213800E for ; Mon, 23 Jul 2012 13:24:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5B5D3E079B; Mon, 23 Jul 2012 13:24:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1CF5AE079B for ; Mon, 23 Jul 2012 13:24:16 +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 57A3A1B430D for ; Mon, 23 Jul 2012 13:24:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 10CE6E5436 for ; Mon, 23 Jul 2012 13:24:14 +0000 (UTC) From: "Ben de Groot" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ben de Groot" Message-ID: <1343049829.894a599380901b860ef50dba593647456267fa71.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: 894a599380901b860ef50dba593647456267fa71 X-VCS-Branch: master Date: Mon, 23 Jul 2012 13:24:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 86e34f33-dd84-4015-9b65-15fd4669c082 X-Archives-Hash: 0bdfa6c69fdf7d76ccde674886eb33aa commit: 894a599380901b860ef50dba593647456267fa71 Author: Ben de Groot gmail com> AuthorDate: Mon Jul 23 13:23:49 2012 +0000 Commit: Ben de Groot gentoo org> CommitDate: Mon Jul 23 13:23:49 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=894a5993 l10n.eclass: rm since it is in the official tree now --- eclass/l10n.eclass | 121 ---------------------------------------------------- 1 files changed, 0 insertions(+), 121 deletions(-) diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass deleted file mode 100644 index 50464e8..0000000 --- a/eclass/l10n.eclass +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -# @ECLASS: l10n.eclass -# @MAINTAINER: -# Ben de Groot -# @BLURB: convenience functions to handle localizations -# @DESCRIPTION: -# The l10n (localization) eclass offers a number of functions to more -# conveniently handle localizations (translations) offered by packages. -# These are meant to prevent code duplication for such boring tasks as -# determining the cross-section between the user's set LINGUAS and what -# is offered by the package; and generating the right list of linguas_* -# USE flags. - -# @ECLASS-VARIABLE: PLOCALES -# @DEFAULT_UNSET -# @DESCRIPTION: -# Variable listing the locales for which localizations are offered by -# the package. Check profiles/desc/linguas.desc to see if the locales -# are listed there. Add any missing ones there. -# -# Example: PLOCALES="cy de el_GR en_US pt_BR vi zh_CN" - -# @ECLASS-VARIABLE: PLOCALE_BACKUP -# @DEFAULT_UNSET -# @DESCRIPTION: -# In some cases the package fails when none of the offered PLOCALES are -# selected by the user. In that case this variable should be set to a -# default locale (usually 'en' or 'en_US') as backup. -# -# Example: PLOCALE_BACKUP="en_US" - -# Add linguas useflags -for u in ${PLOCALES}; do - IUSE+=" linguas_${u}" -done - -# @FUNCTION: l10n_for_each_locale_do -# @USAGE: -# @DESCRIPTION: -# Convenience function for processing localizations. The parameter should -# be a function (defined in the consuming eclass or ebuild) which takes -# an individual localization as (last) parameter. -# -# Example: l10n_for_each_locale_do install_locale -l10n_for_each_locale_do() { - local locs x - locs=$(l10n_get_locales) - for x in ${locs}; do - "${@}" ${x} || die "failed to process enabled ${x} locale" - done -} - -# @FUNCTION: l10n_for_each_disabled_locale_do -# @USAGE: -# @DESCRIPTION: -# Complementary to l10n_for_each_locale_do, this function will process -# locales that are disabled. This could be used for example to remove -# locales from a Makefile, to prevent them from being built needlessly. -l10n_for_each_disabled_locale_do() { - local locs x - locs=$(l10n_get_locales disabled) - for x in ${locs}; do - "${@}" ${x} || die "failed to process disabled ${x} locale" - done -} - -# @FUNCTION: l10n_find_plocales_changes -# @USAGE: -# @DESCRIPTION: -# Ebuild maintenance helper function to find changes in package offered -# locales when doing a version bump. This could be added for example to -# src_prepare -# -# Example: l10n_find_plocales_changes "${S}/src/translations" "${PN}_" '.ts' -l10n_find_plocales_changes() { - [[ $# -ne 3 ]] && die "Exactly 3 arguments are needed!" - einfo "Looking in ${1} for new locales ..." - pushd "${1}" >/dev/null || die "Cannot access ${1}" - local current= x= - for x in ${2}*${3} ; do - x=${x#"${2}"} - x=${x%"${3}"} - current+="${x} " - done - popd >/dev/null - if [[ ${PLOCALES} != ${current%[[:space:]]} ]] ; then - einfo "There are changes in locales! This ebuild should be updated to:" - einfo "PLOCALES=\"${current%[[:space:]]}\"" - else - einfo "Done" - fi -} - -# @FUNCTION: l10n_get_locales -# @USAGE: [disabled] -# @DESCRIPTION: -# Determine which LINGUAS USE flags the user has enabled that are offered -# by the package, as listed in PLOCALES, and return them. In case no -# locales are selected, fall back on PLOCALE_BACKUP. When the disabled -# argument is given, return the disabled useflags instead of the enabled -# ones. This function is normally used internally in this eclass, not by -# l10n.eclass consumers. -l10n_get_locales() { - local disabled_locales enabled_locales loc locs - for loc in ${PLOCALES}; do - if use linguas_${loc}; then - enabled_locales+="${loc} " - else - disabled_locales+="${loc} " - fi - done - if [[ ${1} == disabled ]]; then - locs=${disabled_locales} - else - locs=${enabled_locales:-$PLOCALE_BACKUP} - fi - printf "%s" "${locs}" -}