public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] t0200: "locale" may not exist
Date: Wed, 19 Dec 2012 07:28:24 -0800	[thread overview]
Message-ID: <7vd2y6awo7.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20121219131822.GB7134@sigill.intra.peff.net> (Jeff King's message of "Wed, 19 Dec 2012 08:18:22 -0500")

Jeff King <peff@peff•net> 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"

'\''?

  reply	other threads:[~2012-12-19 15:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19  6:47 [PATCH] t0200: "locale" may not exist Junio C Hamano
2012-12-19 13:18 ` Jeff King
2012-12-19 15:28   ` Junio C Hamano [this message]
2012-12-19 15:32     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vd2y6awo7.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox