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 5DD831384B4 for ; Fri, 13 Nov 2015 21:53:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 473E321C013; Fri, 13 Nov 2015 21:53:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EE26721C013 for ; Fri, 13 Nov 2015 21:53:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7D40634074D for ; Fri, 13 Nov 2015 21:53:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 233E8A39 for ; Fri, 13 Nov 2015 21:53:31 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" Message-ID: <1447451422.ccb1377a18ce8addb21000b0009e360c2641aa8c.arfrever@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/main.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: ccb1377a18ce8addb21000b0009e360c2641aa8c X-VCS-Branch: master Date: Fri, 13 Nov 2015 21:53:31 +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: 70348cda-101c-4fc9-9936-2af79c76a4d2 X-Archives-Hash: faf1b5c9ab4eacd6ab7c032fe452f483 commit: ccb1377a18ce8addb21000b0009e360c2641aa8c Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Fri Nov 13 21:50:22 2015 +0000 Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Fri Nov 13 21:50:22 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ccb1377a _emerge.main.emerge_main(): Make locale variables from configuration files affect locale of emerge process. pym/_emerge/main.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index e75bb0a..5a8b93c 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1072,7 +1072,7 @@ def emerge_main(args=None): # Use system locale. try: - locale.setlocale(locale.LC_ALL, '') + locale.setlocale(locale.LC_ALL, "") except locale.Error as e: writemsg_level("setlocale: %s\n" % e, level=logging.WARN) @@ -1144,6 +1144,19 @@ def emerge_main(args=None): os.umask(0o22) emerge_config = load_emerge_config( action=myaction, args=myfiles, opts=myopts) + + # Make locale variables from configuration files (make.defaults, make.conf) affect locale of emerge process. + for locale_var_name in ("LANGUAGE", "LC_ALL", "LC_ADDRESS", "LC_COLLATE", "LC_CTYPE", + "LC_IDENTIFICATION", "LC_MEASUREMENT", "LC_MESSAGES", "LC_MONETARY", + "LC_NAME", "LC_NUMERIC", "LC_PAPER", "LC_TELEPHONE", "LC_TIME", "LANG"): + locale_var_value = emerge_config.running_config.settings.get(locale_var_name) + if locale_var_value is not None: + os.environ.setdefault(locale_var_name, locale_var_value) + try: + locale.setlocale(locale.LC_ALL, "") + except locale.Error as e: + writemsg_level("setlocale: %s\n" % e, level=logging.WARN) + rval = profile_check(emerge_config.trees, emerge_config.action) if rval != os.EX_OK: return rval