summaryrefslogtreecommitdiff
path: root/eclass/l10n.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-29 10:15:54 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-29 10:15:54 +0100
commit9aa80713372911cec499b3adb2cd746790920916 (patch)
treeb8e99dc5dd60ac2094a27cc52f74aada8df38f05 /eclass/l10n.eclass
parentb4d43e8c611df4a8061b6f88d9e9f6b1e3c83903 (diff)
gentoo resync : 29.06.2021
Diffstat (limited to 'eclass/l10n.eclass')
-rw-r--r--eclass/l10n.eclass53
1 files changed, 4 insertions, 49 deletions
diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass
index 5cf3931b7bf5..b1dff96ded12 100644
--- a/eclass/l10n.eclass
+++ b/eclass/l10n.eclass
@@ -15,11 +15,13 @@
# determining the cross-section between the user's set LINGUAS and what
# is offered by the package.
-case ${EAPI:-0} in
- [567]) ;;
+case ${EAPI} in
+ 5|6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
+inherit strip-linguas
+
if [[ -z ${_L10N_ECLASS} ]]; then
_L10N_ECLASS=1
@@ -130,51 +132,4 @@ l10n_get_locales() {
printf "%s" "${locs}"
}
-# @FUNCTION: strip-linguas
-# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
-# @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