1#! /bin/sh 2 3# Test general filter execution. 4 5tmpfiles="" 6trap 'rm -fr $tmpfiles' 1 2 3 15 7 8if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then 9 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. 10 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then 11 ac_n= ac_c=' 12' ac_t=' ' 13 else 14 ac_n=-n ac_c= ac_t= 15 fi 16else 17 ac_n= ac_c='\c' ac_t= 18fi 19 20# Some fold programs (like SunOS4 and FreeBSD) don't have an option to wrap at 21# spaces. 22echo abc | fold -b -s -w 20 >/dev/null 2>&1 || { 23 echo "Skipping test: fold program not POSIX compliant" 24 rm -fr $tmpfiles; exit 77 25} 26 27# Some fold programs (like HP-UX) insert a newline at the end, if the last 28# line was not terminated with a newline and the -s option was given. 29foldoutputcount=`echo $ac_n "abc$ac_c" | fold -b -s -w 20 | wc -c` 30foldoutputcount=`echo "$foldoutputcount" | sed -e 's/[ ]//g'` 31test "$foldoutputcount" = 3 || { 32 echo "Skipping test: fold program inserts extra newline" 33 rm -fr $tmpfiles; exit 77 34} 35 36tmpfiles="$tmpfiles mfi-test1.po" 37cat <<\EOF > mfi-test1.po 38# HEADER. 39# 40msgid "" 41msgstr "" 42"Project-Id-Version: Bonnie Tyler\n" 43"Content-Type: text/plain; charset=ISO-8859-1\n" 44"Content-Transfer-Encoding: 8bit\n" 45 46#: married-men:4 47#, fuzzy 48msgid "The world is full of married men" 49msgstr "So viele verheiratete M�nner" 50 51#: married-men:5 52msgid "with wives who never understand" 53msgstr "und ihre Frauen verstehen sie nicht" 54 55#: married-men:6 56msgid "They're looking for someone to share" 57msgstr "" 58 59# schwer zu �bersetzen... 60#: married-men:7 61msgid "the excitement of a love affair" 62msgstr "" 63 64#: married-men:8 65msgid "Just as soon as they find you" 66msgstr "" 67 68#: married-men:9 69msgid "They warn you and darn you" 70msgstr "" 71 72#~ msgid "You fly on the wings of romance" 73#~ msgstr "Die Fl�gel der frischen Liebe heben dich zum Himmel" 74 75#, fuzzy 76#~ msgid "In the eyes of the world" 77#~ msgstr "F�r die anderen" 78 79# Etwas freie �bersetzung. 80#~ msgid "You're just another crazy girl" 81#~ msgstr "bist du blo� ein verr�cktes dummes Ding" 82 83#~ msgid "Who loves a married man" 84#~ msgstr "das einen verheirateten Mann liebt" 85EOF 86 87tmpfiles="$tmpfiles mfi-test1.out mfi-test1.err" 88: ${MSGFILTER=msgfilter} 89LC_ALL=C \ 90${MSGFILTER} -i mfi-test1.po -o mfi-test1.out fold -b -s -w 20 >mfi-test1.err 2>&1 91result=$? 92cat mfi-test1.err | grep -v 'warning: Locale charset' | grep -v '^ ' 93test $result = 0 || { rm -fr $tmpfiles; exit 1; } 94 95tmpfiles="$tmpfiles mfi-test1.ok" 96cat <<\EOF > mfi-test1.ok 97# HEADER. 98# 99msgid "" 100msgstr "" 101"Project-Id-Version: \n" 102"Bonnie Tyler\n" 103"Content-Type: \n" 104"text/plain; \n" 105"charset=ISO-8859-1\n" 106"Content-Transfer-Enc\n" 107"oding: 8bit\n" 108 109#: married-men:4 110#, fuzzy 111msgid "The world is full of married men" 112msgstr "" 113"So viele \n" 114"verheiratete M�nner" 115 116#: married-men:5 117msgid "with wives who never understand" 118msgstr "" 119"und ihre Frauen \n" 120"verstehen sie nicht" 121 122#: married-men:6 123msgid "They're looking for someone to share" 124msgstr "" 125 126# schwer zu �bersetzen... 127#: married-men:7 128msgid "the excitement of a love affair" 129msgstr "" 130 131#: married-men:8 132msgid "Just as soon as they find you" 133msgstr "" 134 135#: married-men:9 136msgid "They warn you and darn you" 137msgstr "" 138 139#~ msgid "You fly on the wings of romance" 140#~ msgstr "" 141#~ "Die Fl�gel der \n" 142#~ "frischen Liebe \n" 143#~ "heben dich zum \n" 144#~ "Himmel" 145 146#, fuzzy 147#~ msgid "In the eyes of the world" 148#~ msgstr "F�r die anderen" 149 150# Etwas freie �bersetzung. 151#~ msgid "You're just another crazy girl" 152#~ msgstr "" 153#~ "bist du blo� ein \n" 154#~ "verr�cktes dummes \n" 155#~ "Ding" 156 157#~ msgid "Who loves a married man" 158#~ msgstr "" 159#~ "das einen \n" 160#~ "verheirateten Mann \n" 161#~ "liebt" 162EOF 163 164: ${DIFF=diff} 165${DIFF} mfi-test1.ok mfi-test1.out 166result=$? 167 168rm -fr $tmpfiles 169 170exit $result 171