From 28c6609c86191b9c913cd124437cad1dac4fd5e7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 22 Oct 2000 13:09:28 +0000 Subject: Source lang-default rather than open-coding the setting/exporting of LANG, LC_ALL, and LANGUAGE. --- tests/cp/backup-is-src | 7 +------ tests/cp/cp-mv-backup | 5 +---- tests/cp/same-file | 3 +-- tests/cp/slink-2-slink | 7 +------ tests/cp/symlink-slash | 4 +++- tests/ln/sf-1 | 7 +------ tests/ls/symlink-slash | 3 +-- tests/ls/time-1 | 3 +-- tests/mv/backup-is-src | 7 +------ tests/mv/diag | 7 +------ tests/mv/force | 7 +------ tests/mv/hard-link-1 | 7 +------ tests/mv/i-2 | 7 +------ tests/mv/into-self | 7 +------ tests/mv/into-self-2 | 7 +------ tests/mv/into-self-3 | 7 +------ tests/mv/mv-special-1 | 10 ++-------- tests/mv/part-symlink | 5 +---- tests/mv/partition-perm | 5 +++-- tests/rm/r-2 | 5 +---- 20 files changed, 25 insertions(+), 95 deletions(-) (limited to 'tests') diff --git a/tests/cp/backup-is-src b/tests/cp/backup-is-src index e753e4a59..07741ddcf 100755 --- a/tests/cp/backup-is-src +++ b/tests/cp/backup-is-src @@ -16,12 +16,7 @@ if test $framework_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default # This cp command should exit nonzero. cp --b=simple a~ a > out 2>&1 && fail=1 diff --git a/tests/cp/cp-mv-backup b/tests/cp/cp-mv-backup index fbed6f009..1baadc66b 100755 --- a/tests/cp/cp-mv-backup +++ b/tests/cp/cp-mv-backup @@ -6,11 +6,8 @@ if test "$VERBOSE" = yes; then cp --version fi -LANGUAGE=C; export LANGUAGE -LANG=C; export LANG - # Ensure that ls sorts the same way for everyone. -LC_ALL=C; export LC_ALL +. $srcdir/../lang-default . $srcdir/../envvar-check diff --git a/tests/cp/same-file b/tests/cp/same-file index 6752b4f0e..7ae7ec0bc 100755 --- a/tests/cp/same-file +++ b/tests/cp/same-file @@ -7,8 +7,7 @@ if test "$VERBOSE" = yes; then cp --version fi -LANGUAGE=C; export LANGUAGE -LANG=C; export LANG +. $srcdir/../lang-default VERSION_CONTROL=numbered; export VERSION_CONTROL diff --git a/tests/cp/slink-2-slink b/tests/cp/slink-2-slink index 2c9fd4171..90a3f6f2d 100755 --- a/tests/cp/slink-2-slink +++ b/tests/cp/slink-2-slink @@ -10,12 +10,7 @@ fi . $srcdir/../envvar-check # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default pwd=`pwd` tmp=sl2sl-$$ diff --git a/tests/cp/symlink-slash b/tests/cp/symlink-slash index 9370a2b4c..7fb0c0717 100755 --- a/tests/cp/symlink-slash +++ b/tests/cp/symlink-slash @@ -7,6 +7,8 @@ if test "$VERBOSE" = yes; then cp --version fi +. $srcdir/../lang-default + tmp=t-cpsymsl.$$ framework_failure=0 @@ -23,7 +25,7 @@ fi fail=0 cp -dR symlink/ s || fail=1 -set `LANGUAGE=C LC_ALL=C ls -l s` +set `ls -l s` # Prior to fileutils-4.0q, the following would have output ...`s -> dir' # because the trailing slash was removed unconditionally (now you have to diff --git a/tests/ln/sf-1 b/tests/ln/sf-1 index 894144a8b..424711606 100755 --- a/tests/ln/sf-1 +++ b/tests/ln/sf-1 @@ -21,12 +21,7 @@ if test $test_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default fail=0 ln -sf a b > err 2>&1 && fail=1 diff --git a/tests/ls/symlink-slash b/tests/ls/symlink-slash index ae12b091b..e365f85c7 100755 --- a/tests/ls/symlink-slash +++ b/tests/ls/symlink-slash @@ -20,8 +20,7 @@ if test $framework_failure = 1; then exit 1 fi -LANGUAGE=C; export LANGUAGE -LANG=C; export LANG +. $srcdir/../lang-default fail=0 set `ls -l symlink/` diff --git a/tests/ls/time-1 b/tests/ls/time-1 index c81fcaecf..ba251d714 100755 --- a/tests/ls/time-1 +++ b/tests/ls/time-1 @@ -46,8 +46,7 @@ ln c d || framework_failure=1 # Date output in ls -l is locale-sensitive, so this test fails if the # current locale produces a date that doesn't match the embedded value # here (Jan 15 23:00:00 1998), which is in the C (POSIX) locale. -LC_ALL=C -export LC_ALL +. $srcdir/../lang-default # Before we go any further, verify that touch's -m option works. set -- `ls --full -l a` diff --git a/tests/mv/backup-is-src b/tests/mv/backup-is-src index 90c0bf3b8..7f1e62326 100755 --- a/tests/mv/backup-is-src +++ b/tests/mv/backup-is-src @@ -26,12 +26,7 @@ if test $framework_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default # This mv command should exit nonzero. mv --b=simple $a2 $a > out 2>&1 && fail=1 diff --git a/tests/mv/diag b/tests/mv/diag index 83714fff7..c3fc1b0f9 100755 --- a/tests/mv/diag +++ b/tests/mv/diag @@ -25,12 +25,7 @@ if test $framework_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default # These mv commands should all exit nonzero. diff --git a/tests/mv/force b/tests/mv/force index 1455ef342..9a101e406 100755 --- a/tests/mv/force +++ b/tests/mv/force @@ -20,12 +20,7 @@ if test $framework_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default # This mv command should exit nonzero. mv $ff $ff > out 2>&1 && fail=1 diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1 index 2f4b792a0..3b077ea4f 100755 --- a/tests/mv/hard-link-1 +++ b/tests/mv/hard-link-1 @@ -26,12 +26,7 @@ if test $framework_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default mv $dir $other_partition_tmpdir || fail=1 diff --git a/tests/mv/i-2 b/tests/mv/i-2 index 2d4cbee3a..72f26ed9a 100755 --- a/tests/mv/i-2 +++ b/tests/mv/i-2 @@ -11,12 +11,7 @@ fi . $srcdir/../envvar-check # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default pwd=`pwd` tmp=cp-mv-if-$$ diff --git a/tests/mv/into-self b/tests/mv/into-self index fe48b4f4d..089d160bc 100755 --- a/tests/mv/into-self +++ b/tests/mv/into-self @@ -23,12 +23,7 @@ fi fail=0 # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default # This mv command should fail. mv $dir $file $dir > out 2>&1 && fail=1 diff --git a/tests/mv/into-self-2 b/tests/mv/into-self-2 index 81e151af6..7c8a3404c 100755 --- a/tests/mv/into-self-2 +++ b/tests/mv/into-self-2 @@ -34,12 +34,7 @@ if test $framework_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default # This mv command should exit nonzero. mv $symlink $file > out 2>&1 && fail=1 diff --git a/tests/mv/into-self-3 b/tests/mv/into-self-3 index 94de9c8d3..8641468ef 100755 --- a/tests/mv/into-self-3 +++ b/tests/mv/into-self-3 @@ -19,12 +19,7 @@ if test $framework_failure = 1; then fi # Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG +. $srcdir/../lang-default # This mv command should exit nonzero. mv $dir1 $dir2 $dir2 > out 2>&1 && fail=1 diff --git a/tests/mv/mv-special-1 b/tests/mv/mv-special-1 index 39df45e95..412e1e6f6 100755 --- a/tests/mv/mv-special-1 +++ b/tests/mv/mv-special-1 @@ -1,6 +1,8 @@ #! /bin/sh . $srcdir/setup +# Make sure we get English translations. +. $srcdir/../lang-default if test -z "$other_partition_tmpdir"; then exit 77 @@ -26,14 +28,6 @@ if test $framework_failure = 1; then exit 77 fi -# Make sure we get English translations. -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL -LANG=C -export LANG - fail=0 mv --verbose $null $dir $other_partition_tmpdir > out || fail=1 # Make sure the files are gone. diff --git a/tests/mv/part-symlink b/tests/mv/part-symlink index 254159b89..f2514c297 100755 --- a/tests/mv/part-symlink +++ b/tests/mv/part-symlink @@ -17,11 +17,8 @@ pwd_tmp=$pwd/$tmp . $srcdir/setup . $srcdir/../envvar-check - # Make sure the programs use C-locale formats/translations. -LANGUAGE=C; export LANGUAGE -LC_ALL=C; export LC_ALL -LANG=C; export LANG +. $srcdir/../lang-default if test -z "$other_partition_tmpdir"; then (exit 77); exit diff --git a/tests/mv/partition-perm b/tests/mv/partition-perm index 08eb69b35..3b87676c8 100755 --- a/tests/mv/partition-perm +++ b/tests/mv/partition-perm @@ -8,13 +8,14 @@ fi . $srcdir/setup . $srcdir/../envvar-check +. $srcdir/../lang-default if test -z "$other_partition_tmpdir"; then exit 77 fi -LANGUAGE=C; export LANGUAGE -LANG=C; export LANG +=''; export LANGUAGE +=''; export LANG pwd=`pwd` dir=p-perm-$$ diff --git a/tests/rm/r-2 b/tests/rm/r-2 index a85c61f30..044dd2279 100755 --- a/tests/rm/r-2 +++ b/tests/rm/r-2 @@ -18,10 +18,7 @@ mkdir t t/a t/a/b || framework_failure=1 > t/a/f || framework_failure=1 > t/a/b/g || framework_failure=1 -LANGUAGE=C -export LANGUAGE -LC_ALL=C -export LC_ALL +. $srcdir/../lang-default # FIXME: if this fails, it's a framework failure cat < t/E || framework_failure=1 -- cgit v1.2.3-54-g00ecf