]> git.pld-linux.org Git - packages/parted.git/blob - 0001-tests-Try-several-UTF8-locales.patch
- rel 4; tons of patches from FC
[packages/parted.git] / 0001-tests-Try-several-UTF8-locales.patch
1 From e73c27f435017e22a68383255f15ebaa562dd414 Mon Sep 17 00:00:00 2001
2 From: "Brian C. Lane" <bcl@redhat.com>
3 Date: Wed, 13 Aug 2014 13:40:28 -0700
4 Subject: [PATCH] tests: Try several UTF8 locales
5
6 Not all distributions (Fedora) have C.UTF-8 so try several (en_US, de_DE,
7 fr_FR, es_ES). This may still fail if none exist.
8
9 * tests/t0251-gpt-unicode.sh: Test for en_US de_DE fr_FR es_ES
10 ---
11  tests/t0251-gpt-unicode.sh | 18 +++++++++++++++++-
12  1 file changed, 17 insertions(+), 1 deletion(-)
13
14 diff --git a/tests/t0251-gpt-unicode.sh b/tests/t0251-gpt-unicode.sh
15 index c845950..537aaa1 100755
16 --- a/tests/t0251-gpt-unicode.sh
17 +++ b/tests/t0251-gpt-unicode.sh
18 @@ -22,7 +22,23 @@ dev=loop-file
19  # create zeroed device
20  truncate -s 10m $dev || fail=1
21  
22 -export LC_ALL=C.UTF-8
23 +found_locale=no
24 +for locale in en_US de_DE fr_FR es_ES
25 +do
26 +  LC_ALL="$locale.utf8"
27 +
28 +  # In a UTF-8 locale, the string below prints as 4 characters.
29 +  if [ `printf 'foo\341\264\244' | wc -m` -eq 4 ]; then
30 +    found_locale=yes
31 +    break
32 +  fi
33 +done
34 +
35 +if [ "$found_locale" != "yes" ]; then
36 +  echo "no valid UTF-8 locale found; skipping" >&2
37 +  exit 77
38 +fi
39 +
40  # create gpt label with named partition
41  part_name=$(printf 'foo\341\264\244')
42  parted -s $dev mklabel gpt mkpart primary ext2 1MiB 2MiB name 1 $part_name > empty 2>&1 || fail=1
43 -- 
44 1.9.3
45
This page took 0.079602 seconds and 3 git commands to generate.