parted/0001-tests-Fall-back-to-C.UTF-8-if-no-en_US-available.patch
Brian C. Lane 06fca52438 - Rebase on upstream stable release v3.2
- Drop upstream patches.
- Patch t0251 to use en_US.UTF-8 if possible. Fedora doesn't have C.UTF-8
2014-07-30 14:19:13 -07:00

34 lines
1.1 KiB
Diff

From 9489285380f256bb8072d5e24cecf906b80994b9 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <parted-owner@fedoraproject.org>
Date: Wed, 30 Jul 2014 07:48:49 -0700
Subject: [PATCH] tests: Fall back to C.UTF-8 if no en_US available
Not all distributions (Fedora) have C.UTF-8 so first try en_US and fall
back to it. This may still fail if neither exist.
* tests/t0251-gpt-unicode.sh: Test for en_US and fall back to C.UTF-8
---
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..a51f541 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
+if [ -e "/usr/share/locale/en_US/" ]; then
+ export LC_ALL=en_US.UTF-8
+else
+ export LC_ALL=C.UTF-8
+fi
# 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
--
1.9.3