* [gentoo-dev] [PATCH] l10n.eclass: Disabled locales are the complement of enabled ones.
@ 2018-01-12 21:31 Ulrich Müller
2018-01-12 22:34 ` Sergei Trofimovich
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Müller @ 2018-01-12 21:31 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]
Disabled locales returned by l10n_get_locales() should be the
complement of enabled locales: disabled = PLOCALES \ enabled.
So far, in the case of the enabled set falling back to PLOCALE_BACKUP,
the backup locale would end up being both enabled and disabled.
Closes: https://bugs.gentoo.org/547790
---
eclass/l10n.eclass | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass
index 4b0111934d72..82f4ab113f52 100644
--- a/eclass/l10n.eclass
+++ b/eclass/l10n.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: l10n.eclass
@@ -102,26 +102,22 @@ l10n_find_plocales_changes() {
# are selected, fall back on PLOCALE_BACKUP. When the disabled argument
# is given, return the disabled locales instead of the enabled ones.
l10n_get_locales() {
- local disabled_locales enabled_locales loc locs
+ local loc locs
if [[ -z ${LINGUAS+set} ]]; then
# enable all if unset
- enabled_locales=${PLOCALES}
- elif [[ -z ${LINGUAS} ]]; then
- # disable all if empty
- disabled_locales=${PLOCALES}
+ locs=${PLOCALES}
else
- for loc in ${PLOCALES}; do
- if has ${loc} ${LINGUAS}; then
- enabled_locales+="${loc} "
- else
- disabled_locales+="${loc} "
- fi
+ for loc in ${LINGUAS}; do
+ has ${loc} ${PLOCALES} && locs+="${loc} "
done
fi
+ [[ -z ${locs} ]] && locs=${PLOCALE_BACKUP}
if [[ ${1} == disabled ]]; then
- locs=${disabled_locales}
- else
- locs=${enabled_locales:-${PLOCALE_BACKUP}}
+ local disabled_locs
+ for loc in ${PLOCALES}; do
+ has ${loc} ${locs} || disabled_locs+="${loc} "
+ done
+ locs=${disabled_locs}
fi
printf "%s" "${locs}"
}
--
2.15.1
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [gentoo-dev] [PATCH] l10n.eclass: Disabled locales are the complement of enabled ones.
2018-01-12 21:31 [gentoo-dev] [PATCH] l10n.eclass: Disabled locales are the complement of enabled ones Ulrich Müller
@ 2018-01-12 22:34 ` Sergei Trofimovich
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2018-01-12 22:34 UTC (permalink / raw
To: Ulrich Müller; +Cc: gentoo-dev
On Fri, 12 Jan 2018 22:31:04 +0100
Ulrich Müller <ulm@gentoo.org> wrote:
> Disabled locales returned by l10n_get_locales() should be the
> complement of enabled locales: disabled = PLOCALES \ enabled.
>
> So far, in the case of the enabled set falling back to PLOCALE_BACKUP,
> the backup locale would end up being both enabled and disabled.
What is the actual effect of that? Locale is built but not installed
or something else? (worse? less worse?) It's not clear from the linked bug.
--
Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-12 22:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 21:31 [gentoo-dev] [PATCH] l10n.eclass: Disabled locales are the complement of enabled ones Ulrich Müller
2018-01-12 22:34 ` Sergei Trofimovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox