[parted-devel] [PATCH] tests: check if en_US locale is installed before falling back to C.UTF-8 in t0251-gpt-unicode.sh.

Brian C. Lane bcl at redhat.com
Wed Jun 24 20:19:43 UTC 2015


On Mon, Jun 15, 2015 at 09:49:46AM -0400, Alexander Todorov wrote:
> ---
>  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

Thanks, pushed with a better commit message.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)



More information about the parted-devel mailing list