public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] python-utils-r1.eclass: Change python_export_utf8_locale to deal with LC_ALL=C
@ 2015-11-30 21:40 Mike Gilbert
  0 siblings, 0 replies; only message in thread
From: Mike Gilbert @ 2015-11-30 21:40 UTC (permalink / raw
  To: gentoo-dev

Paludis sets LC_ALL=C to ensure a 'sane' build environment.
We only want to override LC_CTYPE, so we break LC_ALL into separate
LC_* overrides and set LC_ALL to blank.
---
 eclass/python-utils-r1.eclass | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index b163fd8..024e093 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1189,19 +1189,27 @@ python_export_utf8_locale() {
 	type locale >/dev/null || return 0
 
 	if [[ $(locale charmap) != UTF-8 ]]; then
-		if [[ -n ${LC_ALL} ]]; then
-			ewarn "LC_ALL is set to a locale with a charmap other than UTF-8."
-			ewarn "This may trigger build failures in some python packages."
-			return 1
-		fi
-
 		# Try English first, then everything else.
 		local lang locales="en_US.UTF-8 $(locale -a)"
 
 		for lang in ${locales}; do
-			if [[ $(LC_CTYPE=${lang} locale charmap 2>/dev/null) == UTF-8 ]]; then
+			if [[ $(LC_ALL=${lang} locale charmap 2>/dev/null) == UTF-8 ]]; then
 				if _python_check_locale_sanity "${lang}"; then
 					export LC_CTYPE=${lang}
+					if [[ -n ${LC_ALL} ]]; then
+						export LC_NUMERIC=${LC_ALL}
+						export LC_TIME=${LC_ALL}
+						export LC_COLLATE=${LC_ALL}
+						export LC_MONETARY=${LC_ALL}
+						export LC_MESSAGES=${LC_ALL}
+						export LC_PAPER=${LC_ALL}
+						export LC_NAME=${LC_ALL}
+						export LC_ADDRESS=${LC_ALL}
+						export LC_TELEPHONE=${LC_ALL}
+						export LC_MEASUREMENT=${LC_ALL}
+						export LC_IDENTIFICATION=${LC_ALL}
+						export LC_ALL=
+					fi
 					return 0
 				fi
 			fi  
-- 
2.6.3



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-30 21:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-30 21:40 [gentoo-dev] [PATCH] python-utils-r1.eclass: Change python_export_utf8_locale to deal with LC_ALL=C Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox