]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix test failures on Haiku.
authorBruno Haible <bruno@clisp.org>
Tue, 24 Dec 2019 16:37:07 +0000 (17:37 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Apr 2020 11:39:01 +0000 (13:39 +0200)
* gettext-tools/tests/init.cfg (func_filter_POT_Creation_Date): New function.
* gettext-tools/tests/xgettext-*: Use it.

38 files changed:
gettext-tools/tests/init.cfg
gettext-tools/tests/xgettext-appdata-1
gettext-tools/tests/xgettext-c-5
gettext-tools/tests/xgettext-c-c++-1
gettext-tools/tests/xgettext-c-comment-6
gettext-tools/tests/xgettext-c-escape-1
gettext-tools/tests/xgettext-c-escape-2
gettext-tools/tests/xgettext-c-escape-3
gettext-tools/tests/xgettext-desktop-1
gettext-tools/tests/xgettext-desktop-2
gettext-tools/tests/xgettext-glade-1
gettext-tools/tests/xgettext-glade-2
gettext-tools/tests/xgettext-glade-3
gettext-tools/tests/xgettext-glade-4
gettext-tools/tests/xgettext-glade-5
gettext-tools/tests/xgettext-glade-6
gettext-tools/tests/xgettext-glade-7
gettext-tools/tests/xgettext-gsettings-1
gettext-tools/tests/xgettext-java-2
gettext-tools/tests/xgettext-javascript-1
gettext-tools/tests/xgettext-javascript-2
gettext-tools/tests/xgettext-javascript-3
gettext-tools/tests/xgettext-javascript-4
gettext-tools/tests/xgettext-javascript-5
gettext-tools/tests/xgettext-javascript-6
gettext-tools/tests/xgettext-javascript-7
gettext-tools/tests/xgettext-properties-2
gettext-tools/tests/xgettext-properties-3
gettext-tools/tests/xgettext-properties-4
gettext-tools/tests/xgettext-python-1
gettext-tools/tests/xgettext-python-3
gettext-tools/tests/xgettext-rst-1
gettext-tools/tests/xgettext-rst-2
gettext-tools/tests/xgettext-stringtable-1
gettext-tools/tests/xgettext-tcl-1
gettext-tools/tests/xgettext-tcl-4
gettext-tools/tests/xgettext-vala-1
gettext-tools/tests/xgettext-vala-2

index cc981491b0639ad8fd47cbb755f1f0a4191de1f8..813fb0c0e0c4bc237791283646447b32d7039b67 100644 (file)
@@ -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
+}
index 7de80c7c031a421909ff45d7abf00b4f4ea0aa2a..6d57e39d75737a1cb981b1c63066f79cf4fcb7f3 100755 (executable)
@@ -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 <<EOF > xg-gs-1.ok
 # SOME DESCRIPTIVE TITLE.
index 122fe60d903da5b4b9a9e753c02b812c2d8224df..01e9a1908c5b9d18ca164acf23c4d6950bbb42ab 100755 (executable)
@@ -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.
index f6c2cda83cad5fe651ed89b5c8bbf76e583e8a4b..9d0180b146d209c29201b6d975589f574b4ff378 100755 (executable)
@@ -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.
index 6cde93e7033e3f8d8ce571e008337cf03f9f7b85..789317434c5e7f0aa69f819a868db0f349439c0c 100755 (executable)
@@ -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.
index 66a71c308fb5c09635c1df60797eb01b55e62c76..19670b130906d290597c558d8f1bde0ac1c30676 100755 (executable)
@@ -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.
index 203dee243ce02b51dfb354df6e2c179492c440e4..6ef7a1d43b4118ec2366d200059aed4de3cced9f 100755 (executable)
@@ -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.
index 3ad9358b69069d9d9cfaf40995569ef8bffb885d..5f9967d576eabdd9e9557720924f5fd3714abdc7 100755 (executable)
@@ -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.
index a43d2d521c11e02b92c4b95f18ad14942ede9eb3..be859b4fe6c76f96acfb9fe7588235180362b858 100755 (executable)
@@ -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.
index a01f7cfaedcfaa56fd095257757a5d13ef2e0d04..974e75b6238de13f9789ae0a1f1b11842fa63ad9 100755 (executable)
@@ -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.
index e7ae5f663a9a0df49876be2becb5bd141b812817..66bab03ee9647a27380c441400fcaec9ece13db8 100755 (executable)
@@ -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 <<EOF > xg-gl-1.ok
 # SOME DESCRIPTIVE TITLE.
index a5e9558740703596f8b604039b03a0b4291c2cb8..d6856f2f5fc2998d68fd42f77674c1c997152cc9 100755 (executable)
@@ -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.
index 909179f2ecd0039ce30bf5b200b5872502e590fb..5e62888649534b3f6d5b5a6c56c272a4ab514c1d 100755 (executable)
@@ -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.
index d66a0f72be8f0d5bace9beb7e3874767fa946ab0..b9cbd3cba347ea6284474cd09ed64e8df2a16249 100755 (executable)
@@ -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.
index 2ce6132216e09899b6d4fa295e5d76baf99549f2..05719259b16cedd139348b9b210175480b5f5151 100755 (executable)
@@ -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.
index 2eda586193d38ace509cdc7f10ef20be8546c360..84d15ae9bcfaabc98f78fcfac97b1c9340865279 100755 (executable)
@@ -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 <<EOF > 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
index f491472490be65350eb3d1d647176ac6f52c92bd..5d751bf2ab8a209c407d48961ed000a2bc871d13 100755 (executable)
@@ -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.
index 7e958719dcb0ca4d56903d2d2dd4584aa1daf710..6befd96a4454ccc00db388be9fd5b58864f9ce68 100755 (executable)
@@ -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 <<EOF > xg-gs-1.ok
 # SOME DESCRIPTIVE TITLE.
index 5f20864fe115f1497d5f9e061354aa77e66752c1..643f1c743d53b789a743134b46641175a68ca844 100755 (executable)
@@ -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.
index d4a3bf66225a5959dcc4a2898902680ef38dd29a..2ddebc20caf8a56ddfa3ef5dbe6b5db48a3ddf46 100755 (executable)
@@ -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.
index b7c266a7cedc63e7e5e5eeae70bdff45fd3beb26..d3d642814b8a888bd0c695f6a566f1f723b4f109 100755 (executable)
@@ -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.
index ed1f30d6c0c3f03eb2d2c8f93dd9c50709adf1f9..313cff0415bc3358ebb85154d46cc6f4e01fd483 100755 (executable)
@@ -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.
index 5932f6c17e8598d7e6ccc957b9204d7ead096f00..a3eb91112a2cec05dc1c92b6254d68e1c8a7eb2f 100755 (executable)
@@ -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.
index 7baa47de871006b52b71d06bd7d4d37e652c7dac..8cdb6ccdb74a51ad4f56e860ee1b75213d0593fd 100755 (executable)
@@ -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.
index ec2cbddd6fc0d84fbb114923c664cd3f232c5ec4..5193eba882ff23da7ac0131ae13da771d30ab095 100755 (executable)
@@ -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.
index 1f668f9baa9d76bc47640f540fec2b89732a7b5b..c9d1f7eba1c503beafe92ebed7ffcdbfd2fccf6f 100755 (executable)
@@ -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.
index 7329a94288ba0b8aaab1dcbe9b3ffa0edf38fa66..86c2d8e7c44cadbd4fc630abe7da2a569ea2835e 100755 (executable)
@@ -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.
index 3b7cb5d9214b1f4217f036e2d8a96f8749dbc68b..2b73cab27c5e16ee1c7b17c70629514f53c0d770 100755 (executable)
@@ -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.
index 9aff5402779fb8034d1e943b7b8f1e2d7994bf63..782fea5ff15a7e7d5ad215dbf1bc1318649b39a0 100755 (executable)
@@ -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.
index 7a4194ca23e3c0d38df3a701ed15b0df1afde5f7..4901c71e3a5badf3e31315ed924005ce15c63661 100755 (executable)
@@ -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.
index fa19f1d9085c7c292c1bd832addf22a73670f22d..1e13b5793557cacc32b0994acc136f5fa5428f5d 100755 (executable)
@@ -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.
index be1efad7b17736bf6883098b4968766399275117..e7185807dd2536160f15f599bc1148d5f88918ab 100755 (executable)
@@ -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.
index a3bf3e717096a3b7d82e49b3d4fa7f41eaeb3171..cee06ded92fa4c1834b3745b6e66df7f95b1e791 100755 (executable)
@@ -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.
index 4bbe17a98795c1488bd7597a3d92b2002d8b921d..bbd8074a77e05a9e67fb970b1d5de92590a27784 100755 (executable)
@@ -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.
index 2126318857e6f8db570f63cf98207f37fe3cdf1b..5a248cd7487988f1b0c4f0f210fd7af129e10243 100755 (executable)
@@ -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.
index ab6af3d60afd70c4b59bae97c9f66a2507574736..d1582f6f9bb9c741d4b054294c9d399d58c3741c 100755 (executable)
@@ -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.
index 3e16c76501041f4f509825a6728352031d35d85c..a3bb0aa8bd753638fd8d5f64815c87542e769e30 100755 (executable)
@@ -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.
index b6ea86ea8e5f9890d2dc7b2951523b48d07846bf..268e535674681b3b21eef2629e68fe955c85cd66 100755 (executable)
@@ -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.