# 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 # source ./test-lib.sh global GIT_TEXTDOMAINDIR := ""$GIT_BUILD_DIR/po/build/locale"" global GIT_PO_PATH := ""$GIT_BUILD_DIR/po"" export GIT_TEXTDOMAINDIR GIT_PO_PATH source "$GIT_BUILD_DIR"/git-sh-i18n if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON { # is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian global 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 global 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" { # Some of the tests need the reference Icelandic locale test_set_prereq GETTEXT_LOCALE # Exporting for t0202/test.pl global 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" } if test -n $is_IS_iso_locale && test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough" { # 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" } } (CommandList children: [ (C {(.)} {(./test-lib.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:GIT_TEXTDOMAINDIR) op: Equal rhs: {(DQ ($ VSub_Name "$GIT_BUILD_DIR") (/po/build/locale))} spids: [21] ) ] spids: [21] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:GIT_PO_PATH) op: Equal rhs: {(DQ ($ VSub_Name "$GIT_BUILD_DIR") (/po))} spids: [27] ) ] spids: [27] ) (C {(export)} {(GIT_TEXTDOMAINDIR)} {(GIT_PO_PATH)}) (C {(.)} {(DQ ($ VSub_Name "$GIT_BUILD_DIR")) (/git-sh-i18n)}) (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(test_have_prereq)} {(GETTEXT)}) (Pipeline children: [(C {(test_have_prereq)} {(GETTEXT_POISON)})] negated: True ) ] op_id: Op_DAmp ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:is_IS_locale) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [{(locale)} {(-a)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [75] ) ] ) (C {(sed)} {(-n)} { (SQ <"/^is_IS\\.[uU][tT][fF]-*8$/{\n"> <"\t\tp\n"> <"\t\tq\n"> <"\t}"> ) } ) ] negated: False ) ] ) left_token: spids: [70 91] ) } spids: [69] ) ] spids: [69] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:is_IS_iso_locale) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [{(locale)} {(-a)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [104] ) ] ) (C {(sed)} {(-n)} { (SQ <"/^is_IS\\.[iI][sS][oO]8859-*1$/{\n"> <"\t\tp\n"> <"\t\tq\n"> <"\t}"> ) } ) ] negated: False ) ] ) left_token: spids: [99 120] ) } spids: [98] ) ] spids: [98] ) (C {(export)} {(is_IS_locale)} {(is_IS_iso_locale)}) (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(test)} {(-n)} {(DQ ($ VSub_Name "$is_IS_locale"))}) (C {(test)} {($ VSub_Name "$GIT_INTERNAL_GETTEXT_SH_SCHEME")} {(KW_Bang "!") (Lit_Other "=")} {(DQ (fallthrough))} ) ] op_id: Op_DAmp ) ] action: [ (C {(test_set_prereq)} {(GETTEXT_LOCALE)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:GETTEXT_LOCALE) op: Equal rhs: {(1)} spids: [182] ) ] spids: [182] ) (C {(export)} {(GETTEXT_LOCALE)}) (C {(say)} { (DQ ("# lib-gettext: Found '") ($ VSub_Name "$is_IS_locale") ("' as an is_IS UTF-8 locale") ) } ) ] spids: [-1 165] ) ] else_action: [(C {(say)} {(DQ ("# lib-gettext: No is_IS UTF-8 locale available"))})] spids: [200 210] ) (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(test)} {(-n)} {(DQ ($ VSub_Name "$is_IS_iso_locale"))}) (C {(test)} {($ VSub_Name "$GIT_INTERNAL_GETTEXT_SH_SCHEME")} {(KW_Bang "!") (Lit_Other "=")} {(DQ (fallthrough))} ) ] op_id: Op_DAmp ) ] action: [ (C {(test_set_prereq)} {(GETTEXT_ISO_LOCALE)}) (C {(say)} { (DQ ("# lib-gettext: Found '") ($ VSub_Name "$is_IS_iso_locale") ("' as an is_IS ISO-8859-1 locale") ) } ) ] spids: [-1 239] ) ] else_action: [(C {(say)} {(DQ ("# lib-gettext: No is_IS ISO-8859-1 locale available"))})] spids: [261 271] ) ] spids: [-1 62] ) ] spids: [-1 273] ) ] )