Re: [PATCH] t0200: "locale" may not exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> On Tue, Dec 18, 2012 at 10:47:03PM -0800, Junio C Hamano wrote:
>
>> On systems without "locale" installed, t0200-gettext-basic.sh leaked
>> error messages when checking if some test locales are available.
>> Hide them, as they are not very useful.
>
> Obviously correct, though there is another way:
>
>> diff --git a/t/lib-gettext.sh b/t/lib-gettext.sh
>> index 0f76f6c..ae8883a 100644
>> --- a/t/lib-gettext.sh
>> +++ b/t/lib-gettext.sh
>> @@ -14,12 +14,14 @@ export GIT_TEXTDOMAINDIR GIT_PO_PATH
>>  if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON
>
> If we turn this line into:
>
>   test_expect_success GETTEXT,!GETTEXT_POISON 'setup locale' '
>
> then people can see the error output of the setup step in verbose mode.

Ok, so it was not obviously "correct" after all ;-)

> +test_expect_success GETTEXT,!GETTEXT_POISON 'setup locale' '
>  	# is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian
> -	is_IS_locale=$(locale -a | sed -n '/^is_IS\.[uU][tT][fF]-*8$/{
> +	is_IS_locale=$(locale -a | sed -n "/^is_IS\.[uU][tT][fF]-*8\$/{

Do we need to do this \$?

>  		p
>  		q
> -	}')
> +	}")
>  	# is_IS.ISO8859-1 on Solaris and FreeBSD, is_IS.iso88591 on Debian
> -	is_IS_iso_locale=$(locale -a | sed -n '/^is_IS\.[iI][sS][oO]8859-*1$/{
> +	is_IS_iso_locale=$(locale -a | sed -n "/^is_IS\.[iI][sS][oO]8859-*1\$/{
>  		p
>  		q
> -	}')
> +	}")
>  
>  	# Export them as an environment variable so the t0202/test.pl Perl
>  	# test can use it too
> @@ -37,7 +36,7 @@ then
>  		# Exporting for t0202/test.pl
>  		GETTEXT_LOCALE=1
>  		export GETTEXT_LOCALE
> -		say "# lib-gettext: Found '$is_IS_locale' as an is_IS UTF-8 locale"
> +		say "# lib-gettext: Found \"$is_IS_locale\" as an is_IS UTF-8 locale"

'\''?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]