[parted-devel] [PATCH] tests: check if en_US locale is installed before falling back to C.UTF-8 in t0251-gpt-unicode.sh.
Alexander Todorov
atodorov at redhat.com
Mon Jun 15 13:49:46 UTC 2015
---
tests/t0251-gpt-unicode.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/t0251-gpt-unicode.sh b/tests/t0251-gpt-unicode.sh
index c845950..78ad4eb 100755
--- a/tests/t0251-gpt-unicode.sh
+++ b/tests/t0251-gpt-unicode.sh
@@ -22,7 +22,11 @@ dev=loop-file
# create zeroed device
truncate -s 10m $dev || fail=1
-export LC_ALL=C.UTF-8
+LC_ALL=$(locale -a | grep en_US.utf8)
+if [ -z "$LC_ALL" ]; then
+ LC_ALL=C.UTF-8
+fi
+export LC_ALL="$LC_ALL"
# create gpt label with named partition
part_name=$(printf 'foo\341\264\244')
parted -s $dev mklabel gpt mkpart primary ext2 1MiB 2MiB name 1 $part_name > empty 2>&1 || fail=1
--
2.4.3
More information about the parted-devel
mailing list