diff options
Diffstat (limited to 'gettext-tools/tests/lang-php')
-rw-r--r--[-rwxr-xr-x] | gettext-tools/tests/lang-php | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/gettext-tools/tests/lang-php b/gettext-tools/tests/lang-php index 072392c..3bc096d 100755..100644 --- a/gettext-tools/tests/lang-php +++ b/gettext-tools/tests/lang-php @@ -5,10 +5,6 @@ # Assumes an fr_FR locale is installed. # Assumes the following packages are installed: mod_php4-core. -tmpfiles="" -trap 'rm -fr $tmpfiles' 1 2 3 15 - -tmpfiles="$tmpfiles prog.php" cat <<\EOF > prog.php <?php setlocale (LC_ALL, ""); @@ -21,14 +17,10 @@ cat <<\EOF > prog.php ?> EOF -tmpfiles="$tmpfiles l-php-prog.tmp l-php-prog.pot" : ${XGETTEXT=xgettext} -${XGETTEXT} -o l-php-prog.tmp --omit-header --no-location prog.php -test $? = 0 || { rm -fr $tmpfiles; exit 1; } -LC_ALL=C tr -d '\r' < l-php-prog.tmp > l-php-prog.pot -test $? = 0 || { rm -fr $tmpfiles; exit 1; } +${XGETTEXT} -o l-php-prog.tmp --omit-header --no-location prog.php || exit 1 +LC_ALL=C tr -d '\r' < l-php-prog.tmp > l-php-prog.pot || exit 1 -tmpfiles="$tmpfiles l-php-prog.ok" cat <<EOF > l-php-prog.ok msgid "'Your command, please?', asked the waiter." msgstr "" @@ -41,7 +33,6 @@ EOF : ${DIFF=diff} ${DIFF} l-php-prog.ok l-php-prog.pot || exit 1 -tmpfiles="$tmpfiles l-php-fr.po" cat <<\EOF > l-php-fr.po msgid "" msgstr "Content-Type: text/plain; charset=ISO-8859-1\n" @@ -55,17 +46,13 @@ msgid "%s is replaced by %s." msgstr "%2$s remplace %1$s." EOF -tmpfiles="$tmpfiles l-php-fr.po.tmp l-php-fr.po.new" : ${MSGMERGE=msgmerge} -${MSGMERGE} -q -o l-php-fr.po.tmp l-php-fr.po l-php-prog.pot -test $? = 0 || { rm -fr $tmpfiles; exit 1; } -LC_ALL=C tr -d '\r' < l-php-fr.po.tmp > l-php-fr.po.new -test $? = 0 || { rm -fr $tmpfiles; exit 1; } +${MSGMERGE} -q -o l-php-fr.po.tmp l-php-fr.po l-php-prog.pot || exit 1 +LC_ALL=C tr -d '\r' < l-php-fr.po.tmp > l-php-fr.po.new || exit 1 : ${DIFF=diff} ${DIFF} l-php-fr.po l-php-fr.po.new || exit 1 -tmpfiles="$tmpfiles l-php" test -d l-php || mkdir l-php test -d l-php/fr || mkdir l-php/fr test -d l-php/fr/LC_MESSAGES || mkdir l-php/fr/LC_MESSAGES @@ -76,14 +63,14 @@ ${MSGFMT} -o l-php/fr/LC_MESSAGES/prog.mo l-php-fr.po # Test for presence of php version 4.0 or newer with gettext support. (php -v) >/dev/null 2>/dev/null test $? -le 1 \ - || { echo "Skipping test: php not found"; rm -fr $tmpfiles; exit 77; } + || { echo "Skipping test: php not found"; exit 77; } case `php -v | sed -n -e 1p | sed -e 's/^[^0-9]*//'` in [4-9].*) ;; - *) echo "Skipping test: php version too old"; rm -fr $tmpfiles; exit 77;; + *) echo "Skipping test: php version too old"; exit 77;; esac { php -m | grep '^gettext$' >/dev/null; } \ || { echo "Skipping test: php was built without gettext support" - rm -fr $tmpfiles; exit 77 + exit 77 } # Test which of the fr_FR locales are installed. @@ -111,10 +98,9 @@ if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then else echo "Skipping test: no french locale is supported" fi - rm -fr $tmpfiles; exit 77 + exit 77 fi -tmpfiles="$tmpfiles l-php-prog.ok l-php-prog.oku l-php-prog.out" : ${DIFF=diff} cat <<\EOF > l-php-prog.ok «Votre commande, s'il vous plait», dit le garçon. @@ -136,6 +122,4 @@ if test $LOCALE_FR_UTF8 != none; then ${DIFF} l-php-prog.oku l-php-prog.out || exit 1 fi -rm -fr $tmpfiles - exit 0 |