From f56b0749add16d39b36dab4372ac065eb10a3afc Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 24 Dec 2019 17:37:07 +0100 Subject: [PATCH] Fix test failures on Haiku. * gettext-tools/tests/init.cfg (func_filter_POT_Creation_Date): New function. * gettext-tools/tests/xgettext-*: Use it. --- gettext-tools/tests/init.cfg | 18 ++++++++++++++++++ gettext-tools/tests/xgettext-appdata-1 | 2 +- gettext-tools/tests/xgettext-c-5 | 3 +-- gettext-tools/tests/xgettext-c-c++-1 | 6 ++---- gettext-tools/tests/xgettext-c-comment-6 | 3 +-- gettext-tools/tests/xgettext-c-escape-1 | 3 +-- gettext-tools/tests/xgettext-c-escape-2 | 3 +-- gettext-tools/tests/xgettext-c-escape-3 | 3 +-- gettext-tools/tests/xgettext-desktop-1 | 2 +- gettext-tools/tests/xgettext-desktop-2 | 2 +- gettext-tools/tests/xgettext-glade-1 | 2 +- gettext-tools/tests/xgettext-glade-2 | 4 +--- gettext-tools/tests/xgettext-glade-3 | 4 +--- gettext-tools/tests/xgettext-glade-4 | 7 ++----- gettext-tools/tests/xgettext-glade-5 | 12 +++--------- gettext-tools/tests/xgettext-glade-6 | 4 ++-- gettext-tools/tests/xgettext-glade-7 | 2 +- gettext-tools/tests/xgettext-gsettings-1 | 2 +- gettext-tools/tests/xgettext-java-2 | 4 +--- gettext-tools/tests/xgettext-javascript-1 | 4 +--- gettext-tools/tests/xgettext-javascript-2 | 4 +--- gettext-tools/tests/xgettext-javascript-3 | 4 +--- gettext-tools/tests/xgettext-javascript-4 | 4 +--- gettext-tools/tests/xgettext-javascript-5 | 4 +--- gettext-tools/tests/xgettext-javascript-6 | 4 +--- gettext-tools/tests/xgettext-javascript-7 | 4 +--- gettext-tools/tests/xgettext-properties-2 | 4 +--- gettext-tools/tests/xgettext-properties-3 | 4 +--- gettext-tools/tests/xgettext-properties-4 | 4 +--- gettext-tools/tests/xgettext-python-1 | 4 +--- gettext-tools/tests/xgettext-python-3 | 20 +++++--------------- gettext-tools/tests/xgettext-rst-1 | 4 +--- gettext-tools/tests/xgettext-rst-2 | 4 +--- gettext-tools/tests/xgettext-stringtable-1 | 4 +--- gettext-tools/tests/xgettext-tcl-1 | 4 +--- gettext-tools/tests/xgettext-tcl-4 | 4 +--- gettext-tools/tests/xgettext-vala-1 | 8 ++------ gettext-tools/tests/xgettext-vala-2 | 3 +-- 38 files changed, 65 insertions(+), 116 deletions(-) diff --git a/gettext-tools/tests/init.cfg b/gettext-tools/tests/init.cfg index cc981491b..813fb0c0e 100644 --- a/gettext-tools/tests/init.cfg +++ b/gettext-tools/tests/init.cfg @@ -16,3 +16,21 @@ prepare_locale_ () esac fi } + +# func_filter_POT_Creation_Date inputfile outputfile +# creates outputfile from inputfile, filtering out any 'POT-Creation-Date' line. +func_filter_POT_Creation_Date () +{ + # A simple "grep -v 'POT-Creation-Date'" does not work: + # - GNU grep 2.24 produces "Binary file (standard input) matches" in the + # output. The workaround is to use option '--text'. + # - Similarly, OpenBSD 4.0 produces "Binary file (standard input) matches" + # in the output, but here it can be worked around by giving the input + # through a pipe. + # - On native Windows, some 'grep' binaries produce CRLF line endings. Filter + # out the CRs a posteriori. + cat "$1" | LC_ALL=C grep --text -v 'POT-Creation-Date' > "$1".tmq 2>/dev/null \ + || cat "$1" | LC_ALL=C grep -v 'POT-Creation-Date' > "$1".tmq \ + || Exit 1 + LC_ALL=C tr -d '\r' < "$1".tmq > "$2" || Exit 1 +} diff --git a/gettext-tools/tests/xgettext-appdata-1 b/gettext-tools/tests/xgettext-appdata-1 index 7de80c7c0..6d57e39d7 100755 --- a/gettext-tools/tests/xgettext-appdata-1 +++ b/gettext-tools/tests/xgettext-appdata-1 @@ -58,7 +58,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments -o xg-gs-1.tmp xg-gs-1.appdata.xml || Exit 1 -grep -v 'POT-Creation-Date' < xg-gs-1.tmp > xg-gs-1.pot || Exit 1 +func_filter_POT_Creation_Date xg-gs-1.tmp xg-gs-1.pot cat < xg-gs-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-c-5 b/gettext-tools/tests/xgettext-c-5 index 122fe60d9..01e9a1908 100755 --- a/gettext-tools/tests/xgettext-c-5 +++ b/gettext-tools/tests/xgettext-c-5 @@ -11,8 +11,7 @@ EOF ${XGETTEXT} --from-code=ISO-8859-1 --no-location \ -o xg-c-5.tmp xg-c-5.c || Exit 1 -grep -v 'POT-Creation-Date' < xg-c-5.tmp > xg-c-5.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-c-5.tmq > xg-c-5.po || Exit 1 +func_filter_POT_Creation_Date xg-c-5.tmp xg-c-5.po cat <<\EOF > xg-c-5.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-c-c++-1 b/gettext-tools/tests/xgettext-c-c++-1 index f6c2cda83..9d0180b14 100755 --- a/gettext-tools/tests/xgettext-c-c++-1 +++ b/gettext-tools/tests/xgettext-c-c++-1 @@ -80,8 +80,7 @@ EOF ${XGETTEXT} --add-comments --no-location --no-wrap \ -o xg-c-c++-1.tmp xg-c-c++-1.cc || Exit 1 -grep -v 'POT-Creation-Date' < xg-c-c++-1.tmp > xg-c-c++-1.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-c-c++-1.tmq > xg-c-c++-1.po || Exit 1 +func_filter_POT_Creation_Date xg-c-c++-1.tmp xg-c-c++-1.po cat <<\EOF > xg-c-c++-1.ok # SOME DESCRIPTIVE TITLE. @@ -135,8 +134,7 @@ EOF ${XGETTEXT} --add-comments --no-location --no-wrap \ -o xg-c-c++-1c.tmp xg-c-c++-1.c || Exit 1 -grep -v 'POT-Creation-Date' < xg-c-c++-1c.tmp > xg-c-c++-1c.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-c-c++-1c.tmq > xg-c-c++-1c.po || Exit 1 +func_filter_POT_Creation_Date xg-c-c++-1c.tmp xg-c-c++-1c.po cat <<\EOF > xg-c-c++-1c.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-c-comment-6 b/gettext-tools/tests/xgettext-c-comment-6 index 6cde93e70..789317434 100755 --- a/gettext-tools/tests/xgettext-c-comment-6 +++ b/gettext-tools/tests/xgettext-c-comment-6 @@ -7,8 +7,7 @@ ${XGETTEXT} --from-code=ISO-8859-1 --add-comments --no-location --no-wrap \ -o xg-c-comment-6.tmp "$wabs_srcdir"/xg-c-comment-6.c || Exit 1 -grep -v 'POT-Creation-Date' < xg-c-comment-6.tmp > xg-c-comment-6.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-c-comment-6.tmq > xg-c-comment-6.po || Exit 1 +func_filter_POT_Creation_Date xg-c-comment-6.tmp xg-c-comment-6.po cat <<\EOF > xg-c-comment-6.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-c-escape-1 b/gettext-tools/tests/xgettext-c-escape-1 index 66a71c308..19670b130 100755 --- a/gettext-tools/tests/xgettext-c-escape-1 +++ b/gettext-tools/tests/xgettext-c-escape-1 @@ -33,8 +33,7 @@ iconv -f UTF-8 -t EUC-JP < xg-c-escape-1.in.c > xg-c-escape-1.c \ ${XGETTEXT} --from-code=EUC-JP --add-comments --no-location --no-wrap \ -o xg-c-escape-1.tmp xg-c-escape-1.c || Exit 1 -grep -v 'POT-Creation-Date' < xg-c-escape-1.tmp > xg-c-escape-1.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-c-escape-1.tmq > xg-c-escape-1.po || Exit 1 +func_filter_POT_Creation_Date xg-c-escape-1.tmp xg-c-escape-1.po cat <<\EOF > xg-c-escape-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-c-escape-2 b/gettext-tools/tests/xgettext-c-escape-2 index 203dee243..6ef7a1d43 100755 --- a/gettext-tools/tests/xgettext-c-escape-2 +++ b/gettext-tools/tests/xgettext-c-escape-2 @@ -11,8 +11,7 @@ EOF ${XGETTEXT} --from-code=UTF-8 --no-location -kN_ \ -o xg-c-escape-2.tmp xg-c-escape-2.c || Exit 1 -grep -v 'POT-Creation-Date' < xg-c-escape-2.tmp > xg-c-escape-2.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-c-escape-2.tmq > xg-c-escape-2.po || Exit 1 +func_filter_POT_Creation_Date xg-c-escape-2.tmp xg-c-escape-2.po cat <<\EOF > xg-c-escape-2.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-c-escape-3 b/gettext-tools/tests/xgettext-c-escape-3 index 3ad9358b6..5f9967d57 100755 --- a/gettext-tools/tests/xgettext-c-escape-3 +++ b/gettext-tools/tests/xgettext-c-escape-3 @@ -7,8 +7,7 @@ ${XGETTEXT} --no-location --no-wrap \ -o xg-c-escape-3.tmp "$wabs_srcdir"/xg-c-escape-3.c || Exit 1 -grep -v 'POT-Creation-Date' < xg-c-escape-3.tmp > xg-c-escape-3.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-c-escape-3.tmq > xg-c-escape-3.po || Exit 1 +func_filter_POT_Creation_Date xg-c-escape-3.tmp xg-c-escape-3.po cat <<\EOF > xg-c-escape-3.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-desktop-1 b/gettext-tools/tests/xgettext-desktop-1 index a43d2d521..be859b4fe 100755 --- a/gettext-tools/tests/xgettext-desktop-1 +++ b/gettext-tools/tests/xgettext-desktop-1 @@ -54,7 +54,7 @@ Keywords=Keyword1;Keyword2;Key\;word3; EOF ${XGETTEXT} --add-comments -o xg-de-1.tmp xg.desktop || Exit 1 -grep -v 'POT-Creation-Date' < xg-de-1.tmp > xg-desktop.pot || Exit 1 +func_filter_POT_Creation_Date xg-de-1.tmp xg-desktop.pot cat <<\EOF > xg-desktop.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-desktop-2 b/gettext-tools/tests/xgettext-desktop-2 index a01f7cfae..974e75b62 100755 --- a/gettext-tools/tests/xgettext-desktop-2 +++ b/gettext-tools/tests/xgettext-desktop-2 @@ -18,7 +18,7 @@ Keywords=Utility; EOF ${XGETTEXT} --add-comments -o xg-de-2.tmp hello.desktop || Exit 1 -grep -v 'POT-Creation-Date' < xg-de-2.tmp > hello-desktop.pot || Exit 1 +func_filter_POT_Creation_Date xg-de-2.tmp hello-desktop.pot cat <<\EOF > hello-desktop.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-glade-1 b/gettext-tools/tests/xgettext-glade-1 index e7ae5f663..66bab03ee 100755 --- a/gettext-tools/tests/xgettext-glade-1 +++ b/gettext-tools/tests/xgettext-glade-1 @@ -1331,7 +1331,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments -o xg-gl-1.tmp xg-gl-1-widgets.glade || Exit 1 -grep -v 'POT-Creation-Date' < xg-gl-1.tmp > xg-gl-1.pot || Exit 1 +func_filter_POT_Creation_Date xg-gl-1.tmp xg-gl-1.pot cat < xg-gl-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-glade-2 b/gettext-tools/tests/xgettext-glade-2 index a5e955874..d6856f2f5 100755 --- a/gettext-tools/tests/xgettext-glade-2 +++ b/gettext-tools/tests/xgettext-glade-2 @@ -56,9 +56,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments -o xg-gl-2.tmp xg-gl-2-simple.glade || Exit 1 -# Don't simplify this to "grep ... < xg-gl-2.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-gl-2.tmp | grep -v 'POT-Creation-Date' > xg-gl-2.pot +func_filter_POT_Creation_Date xg-gl-2.tmp xg-gl-2.pot cat <<\EOF > xg-gl-2.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-glade-3 b/gettext-tools/tests/xgettext-glade-3 index 909179f2e..5e6288864 100755 --- a/gettext-tools/tests/xgettext-glade-3 +++ b/gettext-tools/tests/xgettext-glade-3 @@ -163,9 +163,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-3.tmp xg-gl-3-asciitable.glade2 || Exit 1 -# Don't simplify this to "grep ... < xg-gl-3.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-gl-3.tmp | grep -v 'POT-Creation-Date' > xg-gl-3.pot +func_filter_POT_Creation_Date xg-gl-3.tmp xg-gl-3.pot cat <<\EOF > xg-gl-3.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-glade-4 b/gettext-tools/tests/xgettext-glade-4 index d66a0f72b..b9cbd3cba 100755 --- a/gettext-tools/tests/xgettext-glade-4 +++ b/gettext-tools/tests/xgettext-glade-4 @@ -36,9 +36,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-4.tmp xg-gl-4.glade || Exit 1 -# Don't simplify this to "grep ... < xg-gl-4.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-gl-4.tmp | grep -v 'POT-Creation-Date' > xg-gl-4.pot +func_filter_POT_Creation_Date xg-gl-4.tmp xg-gl-4.pot cat <<\EOF > xg-gl-4.ok # SOME DESCRIPTIVE TITLE. @@ -91,8 +89,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-4a.tmp xg-gl-4a.glade || Exit 1 -# Look upwards -cat xg-gl-4a.tmp | grep -v 'POT-Creation-Date' > xg-gl-4a.pot +func_filter_POT_Creation_Date xg-gl-4a.tmp xg-gl-4a.pot cat <<\EOF > xg-gl-4a.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-glade-5 b/gettext-tools/tests/xgettext-glade-5 index 2ce613221..05719259b 100755 --- a/gettext-tools/tests/xgettext-glade-5 +++ b/gettext-tools/tests/xgettext-glade-5 @@ -55,9 +55,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-5.tmp xg-gl-5.glade || Exit 1 -# Don't simplify this to "grep ... < xg-gl-5.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-gl-5.tmp | grep -v 'POT-Creation-Date' > xg-gl-5.pot +func_filter_POT_Creation_Date xg-gl-5.tmp xg-gl-5.pot cat <<\EOF > xg-gl-5.ok # SOME DESCRIPTIVE TITLE. @@ -99,9 +97,7 @@ test $result = 0 || { # Check with --extract-all option rm xg-gl-5.tmp ${XGETTEXT} -a -o xg-gl-5.tmp xg-gl-5.glade || Exit 1 -# Don't simplify this to "grep ... < xg-gl-5.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-gl-5.tmp | grep -v 'POT-Creation-Date' > xg-gl-5.pot +func_filter_POT_Creation_Date xg-gl-5.tmp xg-gl-5.pot ${DIFF} xg-gl-5.ok xg-gl-5.pot result=$? @@ -150,9 +146,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-5b.tmp xg-gl-5b.glade 2>/dev/null || Exit 1 -# Don't simplify this to "grep ... < xg-gl-5b.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-gl-5b.tmp | grep -v 'POT-Creation-Date' > xg-gl-5b.pot +func_filter_POT_Creation_Date xg-gl-5b.tmp xg-gl-5b.pot cat <<\EOF > xg-gl-5b.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-glade-6 b/gettext-tools/tests/xgettext-glade-6 index 2eda58619..84d15ae9b 100755 --- a/gettext-tools/tests/xgettext-glade-6 +++ b/gettext-tools/tests/xgettext-glade-6 @@ -33,7 +33,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-6.tmp xg-gl-6.ui || Exit 1 -grep -v 'POT-Creation-Date' < xg-gl-6.tmp > xg-gl-6.pot || Exit 1 +func_filter_POT_Creation_Date xg-gl-6.tmp xg-gl-6.pot cat < xg-gl-6.ok # SOME DESCRIPTIVE TITLE. @@ -71,7 +71,7 @@ test $result = 0 || { # Check with --extract-all option. ${XGETTEXT} -a -o xg-gl-6.tmp xg-gl-6.ui || Exit 1 -grep -v 'POT-Creation-Date' < xg-gl-6.tmp > xg-gl-6.pot || Exit 1 +func_filter_POT_Creation_Date xg-gl-6.tmp xg-gl-6.pot # Must be ignored. ${DIFF} xg-gl-6.ok xg-gl-6.pot diff --git a/gettext-tools/tests/xgettext-glade-7 b/gettext-tools/tests/xgettext-glade-7 index f49147249..5d751bf2a 100755 --- a/gettext-tools/tests/xgettext-glade-7 +++ b/gettext-tools/tests/xgettext-glade-7 @@ -185,7 +185,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-7.tmp xg-gl-7.ui || Exit 1 -grep -v 'POT-Creation-Date' < xg-gl-7.tmp > xg-gl-7.pot || Exit 1 +func_filter_POT_Creation_Date xg-gl-7.tmp xg-gl-7.pot cat <<\EOF > xg-gl-7.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-gsettings-1 b/gettext-tools/tests/xgettext-gsettings-1 index 7e958719d..6befd96a4 100755 --- a/gettext-tools/tests/xgettext-gsettings-1 +++ b/gettext-tools/tests/xgettext-gsettings-1 @@ -44,7 +44,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments -o xg-gs-1.tmp xg-gs-1.gschema.xml || Exit 1 -grep -v 'POT-Creation-Date' < xg-gs-1.tmp > xg-gs-1.pot || Exit 1 +func_filter_POT_Creation_Date xg-gs-1.tmp xg-gs-1.pot cat < xg-gs-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-java-2 b/gettext-tools/tests/xgettext-java-2 index 5f20864fe..643f1c743 100755 --- a/gettext-tools/tests/xgettext-java-2 +++ b/gettext-tools/tests/xgettext-java-2 @@ -57,9 +57,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --from-code=ISO-8859-1 -c -o xg-j-2.tmp xg-j-2.java 2>/dev/null || Exit 1 -# Don't simplify this to "grep ... < xg-j-2.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-j-2.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-j-2.pot +func_filter_POT_Creation_Date xg-j-2.tmp xg-j-2.pot cat <<\EOF > xg-j-2.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-javascript-1 b/gettext-tools/tests/xgettext-javascript-1 index d4a3bf662..2ddebc20c 100755 --- a/gettext-tools/tests/xgettext-javascript-1 +++ b/gettext-tools/tests/xgettext-javascript-1 @@ -21,9 +21,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments=TRANSLATORS: --no-location -o xg-js-1.tmp xg-js-1.js 2>xg-js-1.err test $? = 0 || { cat xg-js-1.err; Exit 1; } -# Don't simplify this to "grep ... < xg-js-1.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-js-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-1.pot +func_filter_POT_Creation_Date xg-js-1.tmp xg-js-1.pot cat <<\EOF > xg-js-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-javascript-2 b/gettext-tools/tests/xgettext-javascript-2 index b7c266a7c..d3d642814 100755 --- a/gettext-tools/tests/xgettext-javascript-2 +++ b/gettext-tools/tests/xgettext-javascript-2 @@ -33,9 +33,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -o xg-js-2.tmp xg-js-2.js 2>xg-js-2.err test $? = 0 || { cat xg-js-2.err; Exit 1; } -# Don't simplify this to "grep ... < xg-js-2.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-js-2.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-2.pot +func_filter_POT_Creation_Date xg-js-2.tmp xg-js-2.pot cat <<\EOF > xg-js-2.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-javascript-3 b/gettext-tools/tests/xgettext-javascript-3 index ed1f30d6c..313cff041 100755 --- a/gettext-tools/tests/xgettext-javascript-3 +++ b/gettext-tools/tests/xgettext-javascript-3 @@ -16,9 +16,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments=TRANSLATORS: --no-location -o xg-js-3.tmp xg-js-3.js 2>xg-js-3.err test $? = 0 || { cat xg-js-3.err; Exit 1; } -# Don't simplify this to "grep ... < xg-js-3.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-js-3.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-3.pot +func_filter_POT_Creation_Date xg-js-3.tmp xg-js-3.pot cat <<\EOF > xg-js-3.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-javascript-4 b/gettext-tools/tests/xgettext-javascript-4 index 5932f6c17..a3eb91112 100755 --- a/gettext-tools/tests/xgettext-javascript-4 +++ b/gettext-tools/tests/xgettext-javascript-4 @@ -12,9 +12,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -o xg-js-4.tmp xg-js-4.js 2>xg-js-4.err test $? = 0 || { cat xg-js-4.err; Exit 1; } -# Don't simplify this to "grep ... < xg-js-4.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-js-4.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-4.pot +func_filter_POT_Creation_Date xg-js-4.tmp xg-js-4.pot cat <<\EOF > xg-js-4.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-javascript-5 b/gettext-tools/tests/xgettext-javascript-5 index 7baa47de8..8cdb6ccdb 100755 --- a/gettext-tools/tests/xgettext-javascript-5 +++ b/gettext-tools/tests/xgettext-javascript-5 @@ -28,9 +28,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -o xg-js-5.tmp xg-js-5.js 2>xg-js-5.err test $? = 0 || { cat xg-js-5.err; Exit 1; } -# Don't simplify this to "grep ... < xg-js-5.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-js-5.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-5.pot +func_filter_POT_Creation_Date xg-js-5.tmp xg-js-5.pot cat <<\EOF > xg-js-5.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-javascript-6 b/gettext-tools/tests/xgettext-javascript-6 index ec2cbddd6..5193eba88 100755 --- a/gettext-tools/tests/xgettext-javascript-6 +++ b/gettext-tools/tests/xgettext-javascript-6 @@ -49,9 +49,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -o xg-js-6.tmp xg-js-6.js 2>xg-js-6.err test $? = 0 || { cat xg-js-6.err; Exit 1; } -# Don't simplify this to "grep ... < xg-js-6.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-js-6.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-6.pot +func_filter_POT_Creation_Date xg-js-6.tmp xg-js-6.pot cat <<\EOF > xg-js-6.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-javascript-7 b/gettext-tools/tests/xgettext-javascript-7 index 1f668f9ba..c9d1f7eba 100755 --- a/gettext-tools/tests/xgettext-javascript-7 +++ b/gettext-tools/tests/xgettext-javascript-7 @@ -29,9 +29,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -o xg-js-7.tmp xg-js-7.js 2>xg-js-7.err test $? = 0 || { cat xg-js-7.err; Exit 1; } -# Don't simplify this to "grep ... < xg-js-7.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-js-7.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-7.pot +func_filter_POT_Creation_Date xg-js-7.tmp xg-js-7.pot cat <<\EOF > xg-js-7.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-properties-2 b/gettext-tools/tests/xgettext-properties-2 index 7329a9428..86c2d8e7c 100755 --- a/gettext-tools/tests/xgettext-properties-2 +++ b/gettext-tools/tests/xgettext-properties-2 @@ -10,9 +10,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-pr-2.tmp xg-pr-2.properties || Exit 1 -# Don't simplify this to "grep ... < xg-pr-2.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-pr-2.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-pr-2.po +func_filter_POT_Creation_Date xg-pr-2.tmp xg-pr-2.po cat <<\EOF > xg-pr-2.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-properties-3 b/gettext-tools/tests/xgettext-properties-3 index 3b7cb5d92..2b73cab27 100755 --- a/gettext-tools/tests/xgettext-properties-3 +++ b/gettext-tools/tests/xgettext-properties-3 @@ -9,9 +9,7 @@ : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-pr-3.tmp xg-pr-3.properties || Exit 1 -# Don't simplify this to "grep ... < xg-pr-3.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-pr-3.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-pr-3.po +func_filter_POT_Creation_Date xg-pr-3.tmp xg-pr-3.po cat <<\EOF > xg-pr-3.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-properties-4 b/gettext-tools/tests/xgettext-properties-4 index 9aff54027..782fea5ff 100755 --- a/gettext-tools/tests/xgettext-properties-4 +++ b/gettext-tools/tests/xgettext-properties-4 @@ -10,9 +10,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-pr-4.tmp xg-pr-4.properties || Exit 1 -# Don't simplify this to "grep ... < xg-pr-4.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-pr-4.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-pr-4.po +func_filter_POT_Creation_Date xg-pr-4.tmp xg-pr-4.po cat <<\EOF > xg-pr-4.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-python-1 b/gettext-tools/tests/xgettext-python-1 index 7a4194ca2..4901c71e3 100755 --- a/gettext-tools/tests/xgettext-python-1 +++ b/gettext-tools/tests/xgettext-python-1 @@ -31,9 +31,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -o xg-py-1.tmp xg-py-1.py 2>xg-py-1.err test $? = 0 || { cat xg-py-1.err; Exit 1; } -# Don't simplify this to "grep ... < xg-py-1.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-py-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-1.pot +func_filter_POT_Creation_Date xg-py-1.tmp xg-py-1.pot cat <<\EOF > xg-py-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-python-3 b/gettext-tools/tests/xgettext-python-3 index fa19f1d90..1e13b5793 100755 --- a/gettext-tools/tests/xgettext-python-3 +++ b/gettext-tools/tests/xgettext-python-3 @@ -57,9 +57,7 @@ ${XGETTEXT} --add-comments=TRANSLATORS: --no-location \ test $? = 1 || { Exit 1; } ${XGETTEXT} --add-comments=TRANSLATORS: --no-location --from-code=euc-jp \ -o xg-py-3a.tmp xg-py-3a.py || Exit 1 -# Don't simplify this to "grep ... < xg-py-3a.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-py-3a.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3a.pot +func_filter_POT_Creation_Date xg-py-3a.tmp xg-py-3a.pot : ${DIFF=diff} ${DIFF} xg-py-3.ok xg-py-3a.pot || Exit 1 @@ -68,9 +66,7 @@ ${DIFF} xg-py-3.ok xg-py-3a.pot || Exit 1 ${XGETTEXT} --add-comments=TRANSLATORS: --no-location \ -o xg-py-3b.tmp xg-py-3b.py || Exit 1 -# Don't simplify this to "grep ... < xg-py-3b.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-py-3b.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3b.pot +func_filter_POT_Creation_Date xg-py-3b.tmp xg-py-3b.pot ${DIFF} xg-py-3.ok xg-py-3b.pot || Exit 1 @@ -79,9 +75,7 @@ ${DIFF} xg-py-3.ok xg-py-3b.pot || Exit 1 ${XGETTEXT} --add-comments=TRANSLATORS: --no-location \ -o xg-py-3u.tmp xg-py-3u.py || Exit 1 -# Don't simplify this to "grep ... < xg-py-3u.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-py-3u.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3u.pot +func_filter_POT_Creation_Date xg-py-3u.tmp xg-py-3u.pot ${DIFF} xg-py-3.ok xg-py-3u.pot || Exit 1 @@ -90,9 +84,7 @@ ${DIFF} xg-py-3.ok xg-py-3u.pot || Exit 1 ${XGETTEXT} --add-comments=TRANSLATORS: --no-location --from-code=iso-8859-1 \ -o xg-py-3c.tmp xg-py-3b.py || Exit 1 -# Don't simplify this to "grep ... < xg-py-3c.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-py-3c.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3c.pot +func_filter_POT_Creation_Date xg-py-3c.tmp xg-py-3c.pot ${DIFF} xg-py-3.ok xg-py-3c.pot || Exit 1 @@ -108,9 +100,7 @@ EOF ${XGETTEXT} --add-comments=TRANSLATORS: \ -o xg-py-3d.tmp xg-py-3d.py || Exit 1 -# Don't simplify this to "grep ... < xg-py-3d.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-py-3d.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3d.pot +func_filter_POT_Creation_Date xg-py-3d.tmp xg-py-3d.pot cat <<\EOF > xg-py-3d.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-rst-1 b/gettext-tools/tests/xgettext-rst-1 index be1efad7b..e7185807d 100755 --- a/gettext-tools/tests/xgettext-rst-1 +++ b/gettext-tools/tests/xgettext-rst-1 @@ -16,9 +16,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-rst-1.tmp xg-rst-1.rst || Exit 1 -# Don't simplify this to "grep ... < xg-rst-1.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-rst-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-rst-1.po +func_filter_POT_Creation_Date xg-rst-1.tmp xg-rst-1.po cat <<\EOF > xg-rst-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-rst-2 b/gettext-tools/tests/xgettext-rst-2 index a3bf3e717..cee06ded9 100755 --- a/gettext-tools/tests/xgettext-rst-2 +++ b/gettext-tools/tests/xgettext-rst-2 @@ -53,9 +53,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-rst-2.tmp xg-rst-2-oldstyle.rsj xg-rst-2-hello.rsj || Exit 1 -# Don't simplify this to "grep ... < xg-rst-2.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-rst-2.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-rst-2.po +func_filter_POT_Creation_Date xg-rst-2.tmp xg-rst-2.po cat <<\EOF > xg-rst-2.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-stringtable-1 b/gettext-tools/tests/xgettext-stringtable-1 index 4bbe17a98..bbd8074a7 100755 --- a/gettext-tools/tests/xgettext-stringtable-1 +++ b/gettext-tools/tests/xgettext-stringtable-1 @@ -22,9 +22,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-stbl-1.tmp xg-stbl-1.strings || Exit 1 -# Don't simplify this to "grep ... < xg-stbl-1.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-stbl-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-stbl-1.po +func_filter_POT_Creation_Date xg-stbl-1.tmp xg-stbl-1.po cat <<\EOF > xg-stbl-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-tcl-1 b/gettext-tools/tests/xgettext-tcl-1 index 212631885..5a248cd74 100755 --- a/gettext-tools/tests/xgettext-tcl-1 +++ b/gettext-tools/tests/xgettext-tcl-1 @@ -24,9 +24,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -k_ -o xg-t-1.tmp xg-t-1.tcl 2>xg-t-1.err test $? = 0 || { cat xg-t-1.err; Exit 1; } -# Don't simplify this to "grep ... < xg-t-1.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-t-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-t-1.pot +func_filter_POT_Creation_Date xg-t-1.tmp xg-t-1.pot cat <<\EOF > xg-t-1.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-tcl-4 b/gettext-tools/tests/xgettext-tcl-4 index ab6af3d60..d1582f6f9 100755 --- a/gettext-tools/tests/xgettext-tcl-4 +++ b/gettext-tools/tests/xgettext-tcl-4 @@ -12,9 +12,7 @@ EOF : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments --no-location -k_ -o xg-t-4.tmp xg-t-4.tcl 2>xg-t-4.err test $? = 0 || { cat xg-t-4.err; Exit 1; } -# Don't simplify this to "grep ... < xg-t-4.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-t-4.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-t-4.pot +func_filter_POT_Creation_Date xg-t-4.tmp xg-t-4.pot cat <<\EOF > xg-t-4.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-vala-1 b/gettext-tools/tests/xgettext-vala-1 index 3e16c7650..a3bb0aa8b 100755 --- a/gettext-tools/tests/xgettext-vala-1 +++ b/gettext-tools/tests/xgettext-vala-1 @@ -93,9 +93,7 @@ EOF ${XGETTEXT} --add-comments --no-location -o xg-vala-1.tmp xg-vala-1.vala 2>xg-vala-1.err test $? = 0 || { cat xg-vala-1.err; Exit 1; } -# Don't simplify this to "grep ... < xg-vala-1.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-vala-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-vala-1.pot +func_filter_POT_Creation_Date xg-vala-1.tmp xg-vala-1.pot cat <<\EOF > xg-vala-1.ok # SOME DESCRIPTIVE TITLE. @@ -149,9 +147,7 @@ test $result = 0 || exit $result # Test --extract-all option. ${XGETTEXT} --extract-all --add-comments --no-location -o xg-vala-1.tmp xg-vala-1.vala 2>xg-vala-1.err test $? = 0 || { cat xg-vala-1.err; Exit 1; } -# Don't simplify this to "grep ... < xg-vala-1.tmp", otherwise OpenBSD 4.0 grep -# only outputs "Binary file (standard input) matches". -cat xg-vala-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-vala-1.pot +func_filter_POT_Creation_Date xg-vala-1.tmp xg-vala-1.pot cat <<\EOF > xg-vala-1.all.ok # SOME DESCRIPTIVE TITLE. diff --git a/gettext-tools/tests/xgettext-vala-2 b/gettext-tools/tests/xgettext-vala-2 index b6ea86ea8..268e53567 100755 --- a/gettext-tools/tests/xgettext-vala-2 +++ b/gettext-tools/tests/xgettext-vala-2 @@ -7,8 +7,7 @@ ${XGETTEXT} --from-code=ISO-8859-1 --add-comments --no-location --no-wrap \ -o xg-vala-2.tmp "$wabs_srcdir"/xg-vala-2.vala || Exit 1 -grep -v 'POT-Creation-Date' < xg-vala-2.tmp > xg-vala-2.tmq || Exit 1 -LC_ALL=C tr -d '\r' < xg-vala-2.tmq > xg-vala-2.po || Exit 1 +func_filter_POT_Creation_Date xg-vala-2.tmp xg-vala-2.po cat <<\EOF > xg-vala-2.ok # SOME DESCRIPTIVE TITLE. -- 2.47.2