#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test msgmerge when a msgid_plural changed but msgid remained the same.
# Reported by Chusslove Illich (Часлав Илић).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test22.po"
cat <<\EOF > mm-test22.po
msgid ""
msgstr ""
msgstr[1] "Engadir %n recursos dende o libro de enderezos"
EOF
-tmpfiles="$tmpfiles mm-test22.pot"
cat <<\EOF > mm-test22.pot
msgid ""
msgstr ""
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mm-test22.tmp.po mm-test22.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test22.tmp.po mm-test22.po mm-test22.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test22.tmp.po > mm-test22.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test22.tmp.po mm-test22.po mm-test22.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test22.tmp.po > mm-test22.new.po || exit 1
-tmpfiles="$tmpfiles mm-test22.ok"
cat <<\EOF > mm-test22.ok
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test22.ok mm-test22.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} mm-test22.ok mm-test22.new.po || exit 1
-tmpfiles="$tmpfiles mm-test22.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o mm-test22.mo mm-test22.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${MSGFMT} --check -o mm-test22.mo mm-test22.new.po || exit 1
exit 0