From: Bruno Haible Date: Sun, 13 Jan 2008 16:58:39 +0000 (+0000) Subject: Avoid test failures due to broken 'grep' program on OpenBSD 4.0. X-Git-Tag: v0.18~471 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ab41f2649ffe26278fb9657b0b81abcd3a799a5;p=thirdparty%2Fgettext.git Avoid test failures due to broken 'grep' program on OpenBSD 4.0. --- diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 10560608d..e5b5f2c3d 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,15 @@ +2008-01-12 Bruno Haible + + * xgettext-glade-2: Use 'grep' with a pipe as input, not a regular + file. + * xgettext-glade-3: Likewise. + * xgettext-java-2: Likewise. + * xgettext-python-1: Likewise. + * xgettext-python-3: Likewise. + * xgettext-stringtable-1: Likewise. + * xgettext-tcl-1: Likewise. + Fixes test failures on OpenBSD 4.0. + 2007-12-24 Bruno Haible * gettext-3-prg.c: Don't include setenv.h. diff --git a/gettext-tools/tests/xgettext-glade-2 b/gettext-tools/tests/xgettext-glade-2 index 1b00b0f6c..a6c56dc6a 100755 --- a/gettext-tools/tests/xgettext-glade-2 +++ b/gettext-tools/tests/xgettext-glade-2 @@ -63,7 +63,9 @@ tmpfiles="$tmpfiles xg-gl-2.tmp xg-gl-2.pot" : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments -o xg-gl-2.tmp simple.glade test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-gl-2.tmp > xg-gl-2.pot +# 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 tmpfiles="$tmpfiles xg-gl-2.ok" cat <<\EOF > xg-gl-2.ok diff --git a/gettext-tools/tests/xgettext-glade-3 b/gettext-tools/tests/xgettext-glade-3 index 9d6622b39..c2041a8b8 100755 --- a/gettext-tools/tests/xgettext-glade-3 +++ b/gettext-tools/tests/xgettext-glade-3 @@ -170,7 +170,9 @@ tmpfiles="$tmpfiles xg-gl-3.tmp xg-gl-3.pot" : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-3.tmp asciitable.glade2 test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-gl-3.tmp > xg-gl-3.pot +# 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 tmpfiles="$tmpfiles xg-gl-3.ok" cat <<\EOF > xg-gl-3.ok diff --git a/gettext-tools/tests/xgettext-java-2 b/gettext-tools/tests/xgettext-java-2 index 10b82083f..165e33d76 100755 --- a/gettext-tools/tests/xgettext-java-2 +++ b/gettext-tools/tests/xgettext-java-2 @@ -62,7 +62,9 @@ tmpfiles="$tmpfiles xg-j-2.tmp xg-j-2.pot" : ${XGETTEXT=xgettext} ${XGETTEXT} --from-code=ISO-8859-1 -c -o xg-j-2.tmp xg-j-2.java 2>/dev/null test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-j-2.tmp | tr -d '\r' > xg-j-2.pot +# 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' | tr -d '\r' > xg-j-2.pot tmpfiles="$tmpfiles xg-j-2.ok" cat <<\EOF > xg-j-2.ok diff --git a/gettext-tools/tests/xgettext-python-1 b/gettext-tools/tests/xgettext-python-1 index 6e9a07eb5..094fa3ae6 100755 --- a/gettext-tools/tests/xgettext-python-1 +++ b/gettext-tools/tests/xgettext-python-1 @@ -28,7 +28,9 @@ tmpfiles="$tmpfiles xg-py-1.err xg-py-1.tmp xg-py-1.pot" : ${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; rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-py-1.tmp | tr -d '\r' > xg-py-1.pot +# 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' | tr -d '\r' > xg-py-1.pot tmpfiles="$tmpfiles xg-py-1.ok" cat <<\EOF > xg-py-1.ok diff --git a/gettext-tools/tests/xgettext-python-3 b/gettext-tools/tests/xgettext-python-3 index 46ae77ba4..44c3c19fb 100755 --- a/gettext-tools/tests/xgettext-python-3 +++ b/gettext-tools/tests/xgettext-python-3 @@ -55,7 +55,9 @@ test $? = 1 || { rm -fr $tmpfiles; exit 1; } ${XGETTEXT} --add-comments=TRANSLATORS: --no-location --from-code=euc-jp \ -o xg-py-3a.tmp xg-py-3a.py test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-py-3a.tmp | tr -d '\r' > xg-py-3a.pot +# 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' | tr -d '\r' > xg-py-3a.pot : ${DIFF=diff} ${DIFF} xg-py-3.ok xg-py-3a.pot @@ -67,7 +69,9 @@ tmpfiles="$tmpfiles xg-py-3b.tmp xg-py-3b.pot" ${XGETTEXT} --add-comments=TRANSLATORS: --no-location \ -o xg-py-3b.tmp xg-py-3b.py test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-py-3b.tmp | tr -d '\r' > xg-py-3b.pot +# 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' | tr -d '\r' > xg-py-3b.pot ${DIFF} xg-py-3.ok xg-py-3b.pot test $? = 0 || { rm -fr $tmpfiles; exit 1; } @@ -79,7 +83,9 @@ tmpfiles="$tmpfiles xg-py-3c.tmp xg-py-3c.pot" ${XGETTEXT} --add-comments=TRANSLATORS: --no-location --from-code=iso-8859-1 \ -o xg-py-3c.tmp xg-py-3b.py test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-py-3c.tmp | tr -d '\r' > xg-py-3c.pot +# 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' | tr -d '\r' > xg-py-3c.pot ${DIFF} xg-py-3.ok xg-py-3c.pot test $? = 0 || { rm -fr $tmpfiles; exit 1; } @@ -99,7 +105,9 @@ tmpfiles="$tmpfiles xg-py-3d.tmp xg-py-3d.pot" ${XGETTEXT} --add-comments=TRANSLATORS: \ -o xg-py-3d.tmp xg-py-3d.py test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-py-3d.tmp | tr -d '\r' > xg-py-3d.pot +# 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' | tr -d '\r' > xg-py-3d.pot tmpfiles="$tmpfiles xg-py-3d.ok" cat <<\EOF > xg-py-3d.ok diff --git a/gettext-tools/tests/xgettext-stringtable-1 b/gettext-tools/tests/xgettext-stringtable-1 index 8d4c94c57..6c055107a 100755 --- a/gettext-tools/tests/xgettext-stringtable-1 +++ b/gettext-tools/tests/xgettext-stringtable-1 @@ -27,7 +27,9 @@ tmpfiles="$tmpfiles xg-st-1.tmp xg-st-1.po" : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-st-1.tmp xg-st-1.strings test $? = 0 || { rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-st-1.tmp | tr -d '\r' > xg-st-1.po +# Don't simplify this to "grep ... < xg-st-1.tmp", otherwise OpenBSD 4.0 grep +# only outputs "Binary file (standard input) matches". +cat xg-st-1.tmp | grep -v 'POT-Creation-Date' | tr -d '\r' > xg-st-1.po tmpfiles="$tmpfiles xg-st-1.ok" cat <<\EOF > xg-st-1.ok diff --git a/gettext-tools/tests/xgettext-tcl-1 b/gettext-tools/tests/xgettext-tcl-1 index 85d38d8a7..91a822282 100755 --- a/gettext-tools/tests/xgettext-tcl-1 +++ b/gettext-tools/tests/xgettext-tcl-1 @@ -28,7 +28,9 @@ tmpfiles="$tmpfiles xg-t-1.err xg-t-1.tmp xg-t-1.pot" : ${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; rm -fr $tmpfiles; exit 1; } -grep -v 'POT-Creation-Date' < xg-t-1.tmp | tr -d '\r' > xg-t-1.pot +# 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' | tr -d '\r' > xg-t-1.pot tmpfiles="$tmpfiles xg-t-1.ok" cat <<\EOF > xg-t-1.ok