#!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test Perl support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-5.pl"
cat <<EOF > xg-pl-5.pl
# This comment will not be extracted.
print gettext "help";
print gettext "The Fabulous Four";
EOF
-tmpfiles="$tmpfiles xg-pl-5.tmp.po xg-pl-5.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-pl-5.tmp xg-pl-5.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-5.tmp.po > xg-pl-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-pl-5.tmp xg-pl-5.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-5.tmp.po > xg-pl-5.po || exit 1
-tmpfiles="$tmpfiles xg-pl-5.ok"
cat <<EOF > xg-pl-5.ok
msgid "help"
msgstr ""
${DIFF} xg-pl-5.ok xg-pl-5.po
result=$?
-rm -fr $tmpfiles
-
exit $result