mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
c74c72034f
A #! line in these files is misleading, since these scriptlets are meant to be sourced with '.' (using whatever shell sources them) instead of run directly using the interpreter named on the #! line. Removing the #! line shouldn't hurt syntax highlighting since these files have filenames ending with '.sh'. For documentation, add a brief description of how the files are meant to be used in place of the shebang line. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
59 lines
1.6 KiB
Bash
59 lines
1.6 KiB
Bash
# Initialization and Icelandic locale for basic git i18n tests,
|
|
# which source this scriptlet instead of ./test-lib.sh.
|
|
#
|
|
# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
|
|
#
|
|
|
|
. ./test-lib.sh
|
|
|
|
GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
|
|
GIT_PO_PATH="$GIT_BUILD_DIR/po"
|
|
export GIT_TEXTDOMAINDIR GIT_PO_PATH
|
|
|
|
. "$GIT_BUILD_DIR"/git-sh-i18n
|
|
|
|
if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON
|
|
then
|
|
# is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian
|
|
is_IS_locale=$(locale -a 2>/dev/null |
|
|
sed -n '/^is_IS\.[uU][tT][fF]-*8$/{
|
|
p
|
|
q
|
|
}')
|
|
# is_IS.ISO8859-1 on Solaris and FreeBSD, is_IS.iso88591 on Debian
|
|
is_IS_iso_locale=$(locale -a 2>/dev/null |
|
|
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
|
|
export is_IS_locale is_IS_iso_locale
|
|
|
|
if test -n "$is_IS_locale" &&
|
|
test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough"
|
|
then
|
|
# Some of the tests need the reference Icelandic locale
|
|
test_set_prereq GETTEXT_LOCALE
|
|
|
|
# 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"
|
|
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
|
|
|
|
say "# lib-gettext: Found '$is_IS_iso_locale' as an is_IS ISO-8859-1 locale"
|
|
else
|
|
say "# lib-gettext: No is_IS ISO-8859-1 locale available"
|
|
fi
|
|
fi
|