From dd544abd49f81be63b5d10de9a1060329834c177 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 19 Feb 2012 15:06:52 +0100 Subject: [PATCH] Fix test failure in many locales on Solaris 11. * tests/test-pipe-filter-gi1.c (main): Don't use range expression in 'tr' arguments. * tests/test-pipe-filter-ii1.c (main): Likewise. * build-aux/bootstrap (check_versions): Run 'tr' command with range expressions in the C locale. * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise. * m4/host-os.m4 (gl_HOST_OS): Likewise. --- ChangeLog | 11 +++++++++++ build-aux/bootstrap | 2 +- m4/fnmatch.m4 | 4 ++-- m4/host-os.m4 | 4 ++-- tests/test-pipe-filter-gi1.c | 9 +++++---- tests/test-pipe-filter-ii1.c | 9 +++++---- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfd09aaef..16e4dad54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2012-02-19 Bruno Haible + Fix test failure in many locales on Solaris 11. + * tests/test-pipe-filter-gi1.c (main): Don't use range expression in + 'tr' arguments. + * tests/test-pipe-filter-ii1.c (main): Likewise. + * build-aux/bootstrap (check_versions): Run 'tr' command with range + expressions in the C locale. + * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise. + * m4/host-os.m4 (gl_HOST_OS): Likewise. + +2012-02-19 Bruno Haible + gnulib-tool: Improve usage message. * gnulib-tool (func_usage): Move doc of --help and --version to the section "Operation modes". diff --git a/build-aux/bootstrap b/build-aux/bootstrap index c8ee3cc67..31eb651f6 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -423,7 +423,7 @@ check_versions() { $use_git || continue fi # Honor $APP variables ($TAR, $AUTOCONF, etc.) - appvar=`echo $app | tr '[a-z]-' '[A-Z]_'` + appvar=`echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_'` test "$appvar" = TAR && appvar=AMTAR case $appvar in GZIP) ;; # Do not use $GZIP: it contains gzip options. diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4 index 07b43500d..e46b6e521 100644 --- a/m4/fnmatch.m4 +++ b/m4/fnmatch.m4 @@ -1,4 +1,4 @@ -# Check for fnmatch - serial 8. +# Check for fnmatch - serial 9. # Copyright (C) 2000-2007, 2009-2012 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], FNMATCH_H= gl_fnmatch_required_lowercase=` - echo $gl_fnmatch_required | tr '[[A-Z]]' '[[a-z]]' + echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]' ` gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch], diff --git a/m4/host-os.m4 b/m4/host-os.m4 index 199c23906..f76f907c7 100644 --- a/m4/host-os.m4 +++ b/m4/host-os.m4 @@ -1,4 +1,4 @@ -# serial 8 +# serial 9 # Copyright (C) 2001, 2003-2004, 2006, 2009-2012 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -66,7 +66,7 @@ AC_DEFUN([gl_HOST_OS], # from $host_os, but capitalizes its first letter. [A-Za-z]*) os=` - expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]' + expr "X$host_os" : 'X\([A-Za-z]\)' | LC_ALL=C tr '[a-z]' '[A-Z]' `` expr "X$host_os" : 'X.\([A-Za-z]*\)' ` diff --git a/tests/test-pipe-filter-gi1.c b/tests/test-pipe-filter-gi1.c index ed84c7adc..d14d4a3f6 100644 --- a/tests/test-pipe-filter-gi1.c +++ b/tests/test-pipe-filter-gi1.c @@ -26,8 +26,9 @@ #include "macros.h" -/* Pipe a text file through 'tr "[a-z]" "[A-Z]"', which converts ASCII - characters from lower case to upper case. */ +/* Pipe a text file through 'LC_ALL=C tr "[a-z]" "[A-Z]"', or equivalently, + 'tr "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"', which + converts ASCII characters from lower case to upper case. */ struct locals { @@ -96,8 +97,8 @@ main (int argc, char *argv[]) l.nread = 0; argv[0] = tr_program; - argv[1] = "[a-z]"; - argv[2] = "[A-Z]"; + argv[1] = "abcdefghijklmnopqrstuvwxyz"; + argv[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; argv[3] = NULL; f = pipe_filter_gi_create ("tr", tr_program, argv, false, true, diff --git a/tests/test-pipe-filter-ii1.c b/tests/test-pipe-filter-ii1.c index baa8d85d2..ac856f5cf 100644 --- a/tests/test-pipe-filter-ii1.c +++ b/tests/test-pipe-filter-ii1.c @@ -26,8 +26,9 @@ #include "macros.h" -/* Pipe a text file through 'tr "[a-z]" "[A-Z]"', which converts ASCII - characters from lower case to upper case. */ +/* Pipe a text file through 'LC_ALL=C tr "[a-z]" "[A-Z]"', or equivalently, + 'tr "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"', which + converts ASCII characters from lower case to upper case. */ struct locals { @@ -119,8 +120,8 @@ main (int argc, char *argv[]) l.nread = 0; argv[0] = tr_program; - argv[1] = "[a-z]"; - argv[2] = "[A-Z]"; + argv[1] = "abcdefghijklmnopqrstuvwxyz"; + argv[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; argv[3] = NULL; result = pipe_filter_ii_execute ("tr", tr_program, argv, false, true, -- 2.11.0