From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 19D93138359 for ; Sat, 12 Sep 2020 16:03:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4B272E0841; Sat, 12 Sep 2020 16:03:31 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 286B7E0841 for ; Sat, 12 Sep 2020 16:03:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3A88E340C39 for ; Sat, 12 Sep 2020 16:03:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AFBBE361 for ; Sat, 12 Sep 2020 16:03:27 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1599926581.7f7a5fcd36ef44dab65639809f49590760f49b68.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/eutils.eclass eclass/l10n.eclass X-VCS-Directories: eclass/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 7f7a5fcd36ef44dab65639809f49590760f49b68 X-VCS-Branch: master Date: Sat, 12 Sep 2020 16:03:27 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0b8beef8-ab06-4b9a-928b-4dc01d588382 X-Archives-Hash: 7050f1a4530a8a10d662ed96c7606407 commit: 7f7a5fcd36ef44dab65639809f49590760f49b68 Author: Ulrich Müller gentoo org> AuthorDate: Wed Sep 9 15:22:54 2020 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sat Sep 12 16:03:01 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f7a5fcd l10n.eclass: strip-linguas() moved from eutils to here. Signed-off-by: Ulrich Müller gentoo.org> eclass/eutils.eclass | 53 ++-------------------------------------------------- eclass/l10n.eclass | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 51 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 0072f4ccf3e..cd59d3f9ccc 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -21,10 +21,10 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in 0|1|2|3|4|5|6) - inherit desktop edos2unix epatch estack ltprune multilib \ + inherit desktop edos2unix epatch estack l10n ltprune multilib \ preserve-libs toolchain-funcs vcs-clean wrapper ;; - 7) inherit edos2unix wrapper ;; + 7) inherit edos2unix l10n wrapper ;; *) die "${ECLASS} is banned in EAPI ${EAPI}" ;; esac @@ -63,55 +63,6 @@ emktemp() { fi } -# @FUNCTION: strip-linguas -# @USAGE: [|<-i|-u> ] -# @DESCRIPTION: -# Make sure that LINGUAS only contains languages that -# a package can support. The first form allows you to -# specify a list of LINGUAS. The -i builds a list of po -# files found in all the directories and uses the -# intersection of the lists. The -u builds a list of po -# files found in all the directories and uses the union -# of the lists. -strip-linguas() { - local ls newls nols - if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then - local op=$1; shift - ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift - local d f - for d in "$@" ; do - if [[ ${op} == "-u" ]] ; then - newls=${ls} - else - newls="" - fi - for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do - if [[ ${op} == "-i" ]] ; then - has ${f} ${ls} && newls="${newls} ${f}" - else - has ${f} ${ls} || newls="${newls} ${f}" - fi - done - ls=${newls} - done - else - ls="$@" - fi - - nols="" - newls="" - for f in ${LINGUAS} ; do - if has ${f} ${ls} ; then - newls="${newls} ${f}" - else - nols="${nols} ${f}" - fi - done - [[ -n ${nols} ]] \ - && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols} - export LINGUAS=${newls:1} -} - path_exists() { eerror "path_exists has been removed. Please see the following post" eerror "for a replacement snippet:" diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass index 73d54ec2233..7bd8f382fbe 100644 --- a/eclass/l10n.eclass +++ b/eclass/l10n.eclass @@ -124,4 +124,51 @@ l10n_get_locales() { printf "%s" "${locs}" } +# @FUNCTION: strip-linguas +# @USAGE: [|<-i|-u> ] +# @DESCRIPTION: +# Make sure that LINGUAS only contains languages that a package can +# support. The first form allows you to specify a list of LINGUAS. +# The -i builds a list of po files found in all the directories and uses +# the intersection of the lists. The -u builds a list of po files found +# in all the directories and uses the union of the lists. +strip-linguas() { + local ls newls nols + if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then + local op=$1; shift + ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift + local d f + for d in "$@" ; do + if [[ ${op} == "-u" ]] ; then + newls=${ls} + else + newls="" + fi + for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do + if [[ ${op} == "-i" ]] ; then + has ${f} ${ls} && newls="${newls} ${f}" + else + has ${f} ${ls} || newls="${newls} ${f}" + fi + done + ls=${newls} + done + else + ls="$@" + fi + + nols="" + newls="" + for f in ${LINGUAS} ; do + if has ${f} ${ls} ; then + newls="${newls} ${f}" + else + nols="${nols} ${f}" + fi + done + [[ -n ${nols} ]] \ + && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols} + export LINGUAS=${newls:1} +} + fi