[PATCH/RFC 10/17] gettext tests: add detection for is_IS.ISO-8859-1 locale

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

 



Add a GETTEXT_ISO_LOCALE prerequisite to lib-gettext.sh, it'll be set
if we have an is_IS.ISO-8859-1 locale.

This is needed for an upcoming test that checks if our gettext library
can recode our UTF-8 po/is.po to is_IS.ISO-8859-1 on request.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 t/lib-gettext.sh |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/t/lib-gettext.sh b/t/lib-gettext.sh
index f0cdd3d..4570ead 100644
--- a/t/lib-gettext.sh
+++ b/t/lib-gettext.sh
@@ -18,9 +18,15 @@ then
 		p
 		q
 	}')
-	# Export it as an environmental variable so the t0202/test.pl Perl
-	# test can use it too
-	export is_IS_locale
+	# 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$/{
+		p
+		q
+	}')
+
+	# Export them as an environmental variable so the t0202/test.pl
+	# Perl test can use it too
+	export is_IS_locale is_IS_iso_locale
 
 	if test -n "$is_IS_locale" &&
 		test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough"
@@ -35,6 +41,20 @@ then
 	else
 		say "# lib-gettext: No is_IS UTF-8 locale available"
 	fi
+
+	if test -n "$is_IS_iso_locale" &&
+		test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough"
+	then
+		# Some of the tests need the reference Icelandic locale
+		test_set_prereq GETTEXT_ISO_LOCALE
+
+		# Exporting for t0202/test.pl
+		GETTEXT_ISO_LOCALE=1
+		export GETTEXT_ISO_LOCALE
+		say "# lib-gettext: Found '$is_IS_iso_locale' as a is_IS ISO-8859-1 locale"
+	else
+		say "# lib-gettext: No is_IS ISO-8859-1 locale available"
+	fi
 else
 	# Only run some tests when we don't have gettext support
 	test_set_prereq NO_GETTEXT
-- 
1.7.2.2.536.g3f548

--
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]