libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] [PATCH] Fix "setlocale: LC_TIME: cannot change locale (e


From: Pete Batard
Subject: [Libcdio-devel] [PATCH] Fix "setlocale: LC_TIME: cannot change locale (en_US", warning during tests
Date: Tue, 31 Jan 2012 16:56:40 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1

This one can be applied to mainline directly.

On some platforms (eg. Slackware Linux) both 'en_US' and 'en_US.utf8' might be defined, which breaks the locale grep in check_common_fn.

This patch adds an extra grep -v to avoid the issue.

Note that we have another problem with using 'locale' on MinGW/msys platforms, as the command may not be present. A check for locale availability, and workaround if not found should probably be added if possible.

Oh, and I'm getting a failed test with mainline (and -pbatard) on Linux at the moment:

./check_cue.sh failed running: cd-info --quiet --no-device-info --cue-file /usr/src/libcdio/data/cdda.cue --no-cddb
./check_cue.sh: cd-info CUE test CD-DA failed in comparing output.
./check_cue.sh: failed command:
/usr/src/libcdio/src/cd-info --quiet --no-device-info --cue-file /usr/src/libcdio/data/cdda.cue --no-cddb
FAIL: check_cue.sh

Regards,

/Pete
>From 6536e6b004d83c5b94e689c7c0470e86bda24926 Mon Sep 17 00:00:00 2001
From: Pete Batard <address@hidden>
Date: Tue, 31 Jan 2012 16:34:31 +0000
Subject: [PATCH] Fix "setlocale: LC_TIME: cannot change locale (en_US"
 warning during tests

* both 'en_US' and 'en_US.utf8' might be defined on some platforms
---
 test/check_common_fn.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/test/check_common_fn.in b/test/check_common_fn.in
index 6310f8b..52cab61 100755
--- a/test/check_common_fn.in
+++ b/test/check_common_fn.in
@@ -20,7 +20,8 @@ SKIP_TEST_EXITCODE=77
 # Some output changes depending on TZ and locale. Set this so we get known
 # results
 TZ=CUT
-LC_TIME=$(locale -a | grep 'en_US' &2>/dev/null)
+# both 'en_US' and 'en_US.utf8' might be defined on some platforms
+LC_TIME=$(locale -a | grep 'en_US' | grep -v 'utf8' &2>/dev/null)
 export TZ LC_TIME
 
 check_result() {
-- 
1.7.8.msysgit.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]