aboutsummaryrefslogtreecommitdiff
path: root/localedata
diff options
context:
space:
mode:
Diffstat (limited to 'localedata')
-rw-r--r--localedata/ChangeLog42
-rw-r--r--localedata/Makefile33
-rw-r--r--localedata/gen-locale.sh10
-rw-r--r--localedata/sort-test.sh14
-rwxr-xr-xlocaledata/tst-ctype.sh9
-rwxr-xr-xlocaledata/tst-fmon.sh17
-rwxr-xr-xlocaledata/tst-langinfo.sh9
-rwxr-xr-xlocaledata/tst-locale.sh11
-rwxr-xr-xlocaledata/tst-mbswcs.sh5
-rw-r--r--localedata/tst-numeric.sh4
-rwxr-xr-xlocaledata/tst-rpmatch.sh2
-rwxr-xr-xlocaledata/tst-trans.sh18
-rwxr-xr-xlocaledata/tst-wctype.sh9
13 files changed, 127 insertions, 56 deletions
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index 134af04c99..7d91d38314 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,45 @@
+2014-06-06 Joseph Myers <joseph@codesourcery.com>
+
+ * Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use
+ $(built-program-cmd-before-env), $(run-program-env) and
+ $(built-program-cmd-after-env).
+ ($(objpfx)sort-test.out): Use $(test-program-prefix-before-env),
+ $(run-program-env) and $(test-program-prefix-after-env).
+ ($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env),
+ $(run-program-env) and $(run-program-prefix-after-env).
+ ($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env),
+ $(run-program-env) and $(built-program-cmd-after-env).
+ ($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env),
+ $(run-program-env), $(run-program-prefix-after-env),
+ $(test-program-prefix-before-env) and
+ $(test-program-prefix-after-env).
+ ($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env),
+ $(run-program-env) and $(test-program-cmd-after-env).
+ ($(objpfx)tst-wctype.out): Likewise.
+ ($(objpfx)tst-langinfo.out): Likewise.
+ ($(objpfx)tst-langinfo-static.out): Likewise.
+ * gen-locale.sh: Use localedef_before_env, run_program_env and
+ localedef_after_env arguments.
+ * sort-test.sh: Use test_program_prefix_before_env,
+ run_program_env and test_program_prefix_after_env arguments.
+ * tst-ctype.sh: Use tst_ctype_before_env, run_program_env and
+ tst_ctype_after_env arguments.
+ * tst-fmon.sh: Use run_program_prefix_before_env, run_program_env
+ and run_program_prefix_after_env arguments.
+ * tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env
+ and tst_langinfo_after_env arguments.
+ * tst-locale.sh: Use localedef_before_env, run_program_env and
+ localedef_after_env arguments.
+ * tst-mbswcs.sh: Do not set environment variables explicitly.
+ * tst-numeric.sh: Likewise.
+ * tst-rpmatch.sh: Likewise.
+ * tst-trans.sh: Use run_program_prefix_before_env,
+ run_program_env, run_program_prefix_after_env,
+ test_program_prefix_before_env and test_program_prefix_after_env
+ arguments.
+ * tst-wctype.sh: Use tst_wctype_before_env, run_program_env and
+ tst_wctype_after_env arguments.
+
2014-06-05 Andreas Schwab <schwab@suse.de>
[BZ #16095]
diff --git a/localedata/Makefile b/localedata/Makefile
index 20da00cf16..6dc25244e1 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -143,7 +143,9 @@ generated-dirs += $(LOCALES)
$(addprefix $(objpfx),$(CTYPE_FILES)): %: \
gen-locale.sh $(common-objpfx)locale/localedef Makefile \
$(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
- @$(SHELL) gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@; \
+ @$(SHELL) gen-locale.sh $(common-objpfx) \
+ '$(built-program-cmd-before-env)' '$(run-program-env)' \
+ '$(built-program-cmd-after-env)' $@; \
$(evaluate-test)
$(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
@@ -151,14 +153,17 @@ $(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
$(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
$(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(test-input) \
+ $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+ '$(run-program-env)' '$(test-program-prefix-after-env)' \
+ $(test-input) \
> $@; \
$(evaluate-test)
$(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \
$(objpfx)sort-test.out \
$(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(run-program-prefix)' \
- '$(test-program-prefix)' tst-fmon.data \
+ $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
+ '$(run-program-env)' '$(run-program-prefix-after-env)' \
+ '$(test-program-prefix)' tst-fmon.data \
> $@; \
$(evaluate-test)
$(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
@@ -169,7 +174,8 @@ $(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
$(evaluate-test)
$(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \
$(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(built-program-cmd)' > $@; \
+ $(SHELL) $< $(common-objpfx) '$(built-program-cmd-before-env)' \
+ '$(run-program-env)' '$(built-program-cmd-after-env)' > $@; \
$(evaluate-test)
$(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
$(objpfx)tst-fmon.out \
@@ -178,7 +184,10 @@ $(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
$(evaluate-test)
$(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
$(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(run-program-prefix)' '$(test-program-prefix)'; \
+ $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
+ '$(run-program-env)' '$(run-program-prefix-after-env)' \
+ '$(test-program-prefix-before-env)' \
+ '$(test-program-prefix-after-env)'; \
$(evaluate-test)
$(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
$(objpfx)tst-mbswcs2 $(objpfx)tst-mbswcs3 \
@@ -189,22 +198,26 @@ $(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
$(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
$(objpfx)sort-test.out \
$(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'; \
+ $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+ '$(run-program-env)' '$(test-program-cmd-after-env)'; \
$(evaluate-test)
$(objpfx)tst-wctype.out: tst-wctype.sh $(objpfx)tst-wctype \
$(objpfx)sort-test.out tst-wctype.input \
$(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'; \
+ $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+ '$(run-program-env)' '$(test-program-cmd-after-env)'; \
$(evaluate-test)
$(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
$(objpfx)sort-test.out \
$(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
+ $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+ '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
$(evaluate-test)
$(objpfx)tst-langinfo-static.out: tst-langinfo.sh $(objpfx)tst-langinfo-static \
$(objpfx)sort-test.out \
$(addprefix $(objpfx),$(CTYPE_FILES))
- $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
+ $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+ '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
$(evaluate-test)
$(objpfx)tst-digits.out: $(objpfx)tst-locale.out
$(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
diff --git a/localedata/gen-locale.sh b/localedata/gen-locale.sh
index d2fde61e32..151634ba14 100644
--- a/localedata/gen-locale.sh
+++ b/localedata/gen-locale.sh
@@ -20,7 +20,9 @@
set -e
common_objpfx="$1"; shift
-localedef="$1"; shift
+localedef_before_env="$1"; shift
+run_program_env="$1"; shift
+localedef_after_env="$1"; shift
locfile="$1"; shift
generate_locale ()
@@ -28,9 +30,9 @@ generate_locale ()
charmap=$1
input=$2
out=$3
- if I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
- ${localedef} --quiet -c -f $charmap -i $input \
- ${common_objpfx}localedata/$out
+ if ${localedef_before_env} ${run_program_env} I18NPATH=. \
+ ${localedef_after_env} --quiet -c -f $charmap -i $input \
+ ${common_objpfx}localedata/$out
then
# The makefile checks the timestamp of the LC_CTYPE file,
# but localedef won't have touched it if it was able to
diff --git a/localedata/sort-test.sh b/localedata/sort-test.sh
index 8a7ca89688..e37129a032 100644
--- a/localedata/sort-test.sh
+++ b/localedata/sort-test.sh
@@ -20,7 +20,9 @@
set -e
common_objpfx=$1; shift
-test_program_prefix=$1; shift
+test_program_prefix_before_env=$1; shift
+run_program_env=$1; shift
+test_program_prefix_after_env=$1; shift
lang=$*
id=${PPID:-100}
@@ -31,8 +33,9 @@ status=0
for l in $lang; do
here=0
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
- LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
- LC_ALL=$l ${test_program_prefix} \
+ ${test_program_prefix_before_env} \
+ ${run_program_env} \
+ LC_ALL=$l ${test_program_prefix_after_env} \
${common_objpfx}localedata/collate-test $id < $cns.in \
> ${common_objpfx}localedata/$cns.out || here=1
cmp -s $cns.in ${common_objpfx}localedata/$cns.out || here=1
@@ -44,8 +47,9 @@ for l in $lang; do
status=1
fi
- LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
- LC_ALL=$l ${test_program_prefix} \
+ ${test_program_prefix_before_env} \
+ ${run_program_env} \
+ LC_ALL=$l ${test_program_prefix_after_env} \
${common_objpfx}localedata/xfrm-test $id < $cns.in \
> ${common_objpfx}localedata/$cns.xout || here=1
cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || here=1
diff --git a/localedata/tst-ctype.sh b/localedata/tst-ctype.sh
index 472f8dc8b0..ae105baaab 100755
--- a/localedata/tst-ctype.sh
+++ b/localedata/tst-ctype.sh
@@ -20,7 +20,9 @@
set -e
common_objpfx=$1; shift
-tst_ctype=$1; shift
+tst_ctype_before_env=$1; shift
+run_program_env=$1; shift
+tst_ctype_after_env=$1; shift
status=0
# Run the test programs.
@@ -31,8 +33,9 @@ for loc in C de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 ja_JP.EUC-JP; do
else
input=/dev/null
fi
- LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
- LC_ALL=$loc ${tst_ctype} < $input \
+ ${tst_ctype_before_env} \
+ ${run_program_env} \
+ LC_ALL=$loc ${tst_ctype_after_env} < $input \
>> ${common_objpfx}localedata/tst-ctype.out || status=1
done
diff --git a/localedata/tst-fmon.sh b/localedata/tst-fmon.sh
index e68aa96409..7f1b2488a2 100755
--- a/localedata/tst-fmon.sh
+++ b/localedata/tst-fmon.sh
@@ -21,9 +21,11 @@
set -e
common_objpfx=$1
-run_program_prefix=$2
-test_program_prefix=$3
-datafile=$4
+run_program_prefix_before_env=$2
+run_program_env=$3
+run_program_prefix_after_env=$4
+test_program_prefix=$5
+datafile=$6
here=`pwd`
@@ -33,9 +35,10 @@ lang=`sed -e '/^#/d' -e '/^$/d' -e '/^C /d' -e '/^tstfmon/d' -e 's/^\([^ ]*\).*/
for cns in `cd ./tst-fmon-locales && ls tstfmon_*`; do
cn=tst-fmon-locales/$cns
fn=charmaps/ISO-8859-1
- I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
- LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
- ${run_program_prefix} ${common_objpfx}locale/localedef \
+ ${run_program_prefix_before_env} \
+ ${run_program_env} \
+ I18NPATH=. LANGUAGE=C \
+ ${run_program_prefix_after_env} ${common_objpfx}locale/localedef \
--quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
done
@@ -46,8 +49,6 @@ while IFS=" " read locale format value expect; do
case "$locale" in '#'*) continue ;; esac
if [ -n "$format" ]; then
expect=`echo "$expect" | sed 's/^\"\(.*\)\"$/\1/'`
- LOCPATH=${common_objpfx}localedata \
- GCONV_PATH=${common_objpfx}/iconvdata \
${test_program_prefix} ${common_objpfx}localedata/tst-fmon \
"$locale" "$format" "$value" "$expect" < /dev/null ||
errcode=$?
diff --git a/localedata/tst-langinfo.sh b/localedata/tst-langinfo.sh
index bd489d024f..df5aed3f55 100755
--- a/localedata/tst-langinfo.sh
+++ b/localedata/tst-langinfo.sh
@@ -20,7 +20,9 @@
set -e
common_objpfx=$1
-tst_langinfo=$2
+tst_langinfo_before_env=$2
+run_program_env=$3
+tst_langinfo_after_env=$4
# Run the test program.
cat <<"EOF" |
@@ -339,7 +341,8 @@ ja_JP.EUC-JP NOEXPR ^([nNnN]|いいえ|イイエ)
# ja_JP.EUC-JP CRNCYSTR JPY
ja_JP.EUC-JP CODESET EUC-JP
EOF
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=tt_TT ${tst_langinfo}
+${tst_langinfo_before_env} \
+${run_program_env} \
+LC_ALL=tt_TT ${tst_langinfo_after_env}
exit $?
diff --git a/localedata/tst-locale.sh b/localedata/tst-locale.sh
index b89dc095fa..7c71dcf72c 100755
--- a/localedata/tst-locale.sh
+++ b/localedata/tst-locale.sh
@@ -21,7 +21,9 @@
set -e
common_objpfx=$1; shift
-localedef=$1; shift
+localedef_before_env=$1; shift
+run_program_env=$1; shift
+localedef_after_env=$1; shift
test_locale ()
{
@@ -32,9 +34,10 @@ test_locale ()
if test $rep; then
rep="--repertoire-map $rep"
fi
- I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
- LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
- ${localedef} --quiet -c -f $charmap -i $input \
+ ${localedef_before_env} \
+ ${run_program_env} \
+ I18NPATH=. LANGUAGE=C \
+ ${localedef_after_env} --quiet -c -f $charmap -i $input \
${rep} ${common_objpfx}localedata/$out
if [ $? -ne 0 ]; then
diff --git a/localedata/tst-mbswcs.sh b/localedata/tst-mbswcs.sh
index 6a70fd7b62..1cfc482307 100755
--- a/localedata/tst-mbswcs.sh
+++ b/localedata/tst-mbswcs.sh
@@ -25,23 +25,18 @@ test_program_prefix=$1; shift
status=0
# Run the test programs.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs1 \
> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs2 \
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs3 \
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs4 \
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs5 \
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
diff --git a/localedata/tst-numeric.sh b/localedata/tst-numeric.sh
index ff797cd9fa..734466e975 100644
--- a/localedata/tst-numeric.sh
+++ b/localedata/tst-numeric.sh
@@ -30,9 +30,7 @@ errcode=0
while IFS=" " read locale format value expect; do
case "$locale" in '#'*) continue ;; esac
if [ -n "$format" ]; then
- if LOCPATH=${common_objpfx}localedata \
- GCONV_PATH=${common_objpfx}/iconvdata \
- ${test_program_prefix} ${common_objpfx}localedata/tst-numeric \
+ if ${test_program_prefix} ${common_objpfx}localedata/tst-numeric \
"$locale" "$format" "$value" "$expect" < /dev/null
then
echo "Locale: \"${locale}\" Format: \"${format}\"" \
diff --git a/localedata/tst-rpmatch.sh b/localedata/tst-rpmatch.sh
index bdb3b7c269..a0fd9140f2 100755
--- a/localedata/tst-rpmatch.sh
+++ b/localedata/tst-rpmatch.sh
@@ -26,8 +26,6 @@ tst_rpmatch=$2
rc=0
while IFS=\& read locale string result dummy; do
if [ "$locale" != "#" ]; then
- LOCPATH=${common_objpfx}localedata \
- GCONV_PATH=${common_objpfx}/iconvdata \
${tst_rpmatch} $locale $string $result < /dev/null \
|| { echo "$locale $string $result FAILED"; exit 1; }
fi
diff --git a/localedata/tst-trans.sh b/localedata/tst-trans.sh
index e82e4f8b63..99190a5623 100755
--- a/localedata/tst-trans.sh
+++ b/localedata/tst-trans.sh
@@ -20,20 +20,26 @@
set -e
common_objpfx=$1
-run_program_prefix=$2
-test_program_prefix=$3
+run_program_prefix_before_env=$2
+run_program_env=$3
+run_program_prefix_after_env=$4
+test_program_prefix_before_env=$5
+test_program_prefix_after_env=$6
# Generate the necessary locale data.
-I18NPATH=. GCONV_PATH=${common_objpfx}/iconvdata \
-${run_program_prefix} \
+${run_program_prefix_before_env} \
+${run_program_env} \
+I18NPATH=. \
+${run_program_prefix_after_env} \
${common_objpfx}locale/localedef --quiet \
-i tests/trans.def -f charmaps/ISO-8859-1 \
${common_objpfx}localedata/tt_TT ||
exit 1
# Run the test program.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=tt_TT ${test_program_prefix} \
+${test_program_prefix_before_env} \
+${run_program_env} \
+LC_ALL=tt_TT ${test_program_prefix_after_env} \
${common_objpfx}localedata/tst-trans > ${common_objpfx}localedata/tst-trans.out
exit $?
diff --git a/localedata/tst-wctype.sh b/localedata/tst-wctype.sh
index 31d57bc514..53b88b50b6 100755
--- a/localedata/tst-wctype.sh
+++ b/localedata/tst-wctype.sh
@@ -20,11 +20,14 @@
set -e
common_objpfx=$1
-tst_wctype=$2
+tst_wctype_before_env=$2
+run_program_env=$3
+tst_wctype_after_env=$4
# Run the test program.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=ja_JP.EUC-JP ${tst_wctype} < tst-wctype.input \
+${tst_wctype_before_env} \
+${run_program_env} \
+LC_ALL=ja_JP.EUC-JP ${tst_wctype_after_env} < tst-wctype.input \
> ${common_objpfx}localedata/tst-wctype.out
exit $?