Patchwork [gccgo] Force "C" locale in gotest

login
register
mail settings
Submitter Ian Taylor
Date July 20, 2010, 12:22 p.m.
Message ID <mcrd3uifilg.fsf@google.com>
Download mbox | patch
Permalink /patch/59304/
State New
Headers show

Comments

Ian Taylor - July 20, 2010, 12:22 p.m.
This patch forces the use of the "C" locale in gotest, so that egrep
does the right thing.  Committed to gccgo branch.

Ian
Andreas Schwab - July 20, 2010, 12:28 p.m.
Ian Lance Taylor <iant@google.com> writes:

> +# Makes egrep,grep work better in general if we put them
> +# in ordinary C mode instead of what the current language is.
> +unset LANG
> +export LC_ALL=C
> +export LC_CTYPE=C

If you already set LC_ALL there is no need to set any other LC_*, since
LC_ALL overrides them all.

Andreas.
Ian Taylor - July 20, 2010, 1:11 p.m.
Andreas Schwab <schwab@redhat.com> writes:

> Ian Lance Taylor <iant@google.com> writes:
>
>> +# Makes egrep,grep work better in general if we put them
>> +# in ordinary C mode instead of what the current language is.
>> +unset LANG
>> +export LC_ALL=C
>> +export LC_CTYPE=C
>
> If you already set LC_ALL there is no need to set any other LC_*, since
> LC_ALL overrides them all.

Yeah.  I was just copying code from another version of gotest.  I should
have mentioned that.

Ian

Patch

diff -r 8f87e072151f libgo/testsuite/gotest
--- a/libgo/testsuite/gotest	Mon Jul 19 01:42:34 2010 -0700
+++ b/libgo/testsuite/gotest	Tue Jul 20 05:21:29 2010 -0700
@@ -8,6 +8,12 @@ 
 # tests.
 # If files are named on the command line, use them instead of test*.go.
 
+# Makes egrep,grep work better in general if we put them
+# in ordinary C mode instead of what the current language is.
+unset LANG
+export LC_ALL=C
+export LC_CTYPE=C
+
 GC=${GC:-gccgo}
 GL=${GL:-${GC-gccgo}}
 GOLIBS=${GOLIBS:=-lgotesting}