commit:     699fde68df48c504dbea6983a77551a013ca8d4d
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 10 18:22:15 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Oct 10 18:22:54 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=699fde68

python-utils-r1.eclass: python_export_utf8_locale: do not spew warnings when 
`locale` is not available

If the `locale` isn't available, there's nothing this func can do,
so just return quickly and assume the system is sane.

 eclass/python-utils-r1.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 622cb59..a80bdf4 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1117,6 +1117,9 @@ python_fix_shebang() {
 python_export_utf8_locale() {
        debug-print-function ${FUNCNAME} "${@}"
 
+       # If the locale program isn't available, just return.
+       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."

Reply via email to