tags 464491 + patch thanks The previous patch fails to apply cleanly. Attached is a new patch to resolve this issue.
-- Regards, Andres
diff -urN apertium-3.0.7+1.old/apertium/apertium-header.sh apertium-3.0.7+1/apertium/apertium-header.sh
--- apertium-3.0.7+1.old/apertium/apertium-header.sh 2008-12-01 01:12:29.000000000 -0500
+++ apertium-3.0.7+1/apertium/apertium-header.sh 2008-12-01 01:22:33.000000000 -0500
@@ -1,8 +1,9 @@
+#! /bin/sh
PAIR=""
INPUT_FILE=""
OUTPUT_FILE=""
-function message
+message()
{
echo "USAGE: $(basename $0) [-d datadir] [-f format] [-u] <translation> [in [out]]"
echo " -d datadir directory of linguistic data"
@@ -14,29 +15,29 @@
exit 1;
}
-function locale_utf8
+locale_utf8()
{
export LC_CTYPE=$(locale -a|grep -i "utf[.]*8"|head -1);
- if [[ LC_CTYPE == "" ]]
+ if [ $LC_CTYPE = "" ]
then echo "Error: Install an UTF-8 locale in your system";
exit 1;
fi
}
-function test_zip
+test_zip()
{
- if [[ $(which zip) == "" ]]
+ if [ $(which zip) = "" ]
then echo "Error: Install 'zip' command in your system";
exit 1;
fi
- if [[ $(which unzip) == "" ]]
+ if [ $(which unzip) = "" ]
then echo "Error: Install 'unzip' command in your system";
exit 1;
fi
}
-function random_suffix
+random_suffix()
{
TEMP_FILE="$(mktemp)"
TARGET="${TEMP_FILE}${1}"
@@ -44,14 +45,14 @@
echo "${TARGET}"
}
-function translate_odt
+translate_odt()
{
INPUT_TMPDIR=`mktemp`
locale_utf8
test_zip
- if [[ $FICHERO == "" ]]
+ if [ $FICHERO = "" ]
then FICHERO=`mktemp`
cat > $FICHERO
BORRAFICHERO="true"
@@ -74,31 +75,31 @@
cd $VUELVE
rm -Rf $INPUT_TMPDIR
- if [[ $BORRAFICHERO == "true" ]]
+ if [ $BORRAFICHERO = "true" ]
then rm -Rf $FICHERO;
fi
- if [[ $SALIDA == "" ]]
+ if [ $SALIDA = "" ]
then cat $OTRASALIDA;
rm -Rf $OTRASALIDA
else mv $OTRASALIDA $SALIDA
fi
}
-function translate_docx
+translate_docx()
{
INPUT_TMPDIR=`mktemp`
locale_utf8
test_zip
- if [[ $FICHERO == "" ]]
+ if [ $FICHERO = "" ]
then FICHERO=`mktemp`
cat > $FICHERO
BORRAFICHERO="true"
fi
OTRASALIDA=$(random_suffix docxsalida.zip)
- if [[ $UWORDS == "no" ]]
+ if [ $UWORDS = "no" ]
then OPCIONU="-u";
else OPCIONU="";
fi
@@ -127,24 +128,24 @@
cd $VUELVE
rm -Rf $INPUT_TMPDIR
- if [[ $BORRAFICHERO == "true" ]]
+ if [ $BORRAFICHERO = "true" ]
then rm -Rf $FICHERO;
fi
- if [[ $SALIDA == "" ]]
+ if [ $SALIDA = "" ]
then cat $OTRASALIDA;
rm -Rf $OTRASALIDA
else mv $OTRASALIDA $SALIDA
fi
}
-function translate_xlsx
+translate_xlsx()
{
INPUT_TMPDIR=`mktemp`
locale_utf8
test_zip
- if [[ $FICHERO == "" ]]
+ if [ $FICHERO = "" ]
then FICHERO=`mktemp`
cat > $FICHERO
BORRAFICHERO="true"
@@ -167,10 +168,10 @@
cd $VUELVE
rm -Rf $INPUT_TMPDIR
- if [[ $BORRAFICHERO == "true" ]]
+ if [ $BORRAFICHERO = "true" ]
then rm -Rf $FICHERO;
fi
- if [[ $SALIDA == "" ]]
+ if [ $SALIDA = "" ]
then cat $OTRASALIDA;
rm -Rf $OTRASALIDA
else mv $OTRASALIDA $SALIDA
@@ -234,7 +235,7 @@
if [ ! -e $DATOS/modes/$PREFIJO.mode ];
then echo -n "Error: Mode $PREFIJO does not exist";
c=$(find $DATOS/modes|wc -l)
- if((c <= 1));
+ if $(($c <= 1));
then echo ".";
else echo ". Try one of:";
for i in $DATOS/modes/*.mode;
@@ -248,16 +249,16 @@
case "$FORMATADOR" in
txt|rtf|html)
- if [[ $UWORDS == "no" ]]; then OPTION="-n";
+ if [ $UWORDS = "no" ]; then OPTION="-n";
else OPTION="-g";
fi;
;;
rtf)
- if [[ $UWORDS == "no" ]]; then OPTION="-n";
+ if [ $UWORDS = "no" ]; then OPTION="-n";
else OPTION="-g";
fi;
MILOCALE=$(locale -a|grep -i -v "utf\|^C$\|^POSIX$"|head -1);
- if [[ $MILOCALE == "" ]]
+ if [ $MILOCALE = "" ]
then echo "Error: Install a ISO-8859-1 compatible locale in your system";
exit 1;
fi
@@ -265,21 +266,21 @@
;;
odt)
- if [[ $UWORDS == "no" ]]; then OPTION="-n";
+ if [ $UWORDS = "no" ]; then OPTION="-n";
else OPTION="-g";
fi;
translate_odt
exit 0
;;
docx)
- if [[ $UWORDS == "no" ]]; then OPTION="-n";
+ if [ $UWORDS = "no" ]; then OPTION="-n";
else OPTION="-g";
fi;
translate_docx
exit 0
;;
xlsx)
- if [[ $UWORDS == "no" ]]; then OPTION="-n";
+ if [ $UWORDS = "no" ]; then OPTION="-n";
else OPTION="-g";
fi;
translate_xlsx
@@ -288,7 +289,7 @@
wxml)
- if [[ $UWORDS == "no" ]]; then OPTION="-n";
+ if [ $UWORDS = "no" ]; then OPTION="-n";
else OPTION="-g";
fi;
locale_utf8
@@ -306,7 +307,7 @@
FORMATADOR="rtf";
OPTION="-n";
MILOCALE=$(locale -a|grep -i -v "utf\|^C$\|^POSIX$"|head -1);
- if [[ $MILOCALE == "" ]]
+ if [ $MILOCALE = "" ]
then echo "Error: Install a ISO-8859-1 compatible locale in your system";
exit 1;
fi
diff -urN apertium-3.0.7+1.old/apertium/deformat-header.sh apertium-3.0.7+1/apertium/deformat-header.sh
--- apertium-3.0.7+1.old/apertium/deformat-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/deformat-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,3 +1,4 @@
+#! /bin/sh
if [ $# != 2 ]
then if [ $# != 3 ]
then echo "USAGE: $(basename $0) -[aAmM] <input_file> <output_file>";
@@ -35,13 +36,13 @@
exit 1;
fi
- if [ $1 == "-a" ]
+ if [ $1 = "-a" ]
then FLEXOPTS="";
MODE="apertium";
- elif [ $1 == "-m" ]
+ elif [ $1 = "-m" ]
then FLEXOPTS="";
MODE="matxin";
- elif [ $1 == "-M" ]
+ elif [ $1 = "-M" ]
then FLEXOPTS="-Cfer";
MODE="matxin";
fi
diff -urN apertium-3.0.7+1.old/apertium/gen-header.sh apertium-3.0.7+1/apertium/gen-header.sh
--- apertium-3.0.7+1.old/apertium/gen-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/gen-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,3 +1,4 @@
+#! /bin/sh
if [ $# != 2 ]
then if [ $# != 3 ]
then echo "USAGE: $(basename $0) [-O] <input_file> <output_file>";
diff -urN apertium-3.0.7+1.old/apertium/gen-stopwords-lextor.sh apertium-3.0.7+1/apertium/gen-stopwords-lextor.sh
--- apertium-3.0.7+1.old/apertium/gen-stopwords-lextor.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/gen-stopwords-lextor.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,4 +1,4 @@
-
+#! /bin/sh
if [ $# != 3 ]
then echo "USAGE: $(basename $0) <n> <input_file> <output_file>" 1>&2
echo "where <n> is the desired number of stopwords" 1>&2
diff -urN apertium-3.0.7+1.old/apertium/gen-wlist-lextor-header.sh apertium-3.0.7+1/apertium/gen-wlist-lextor-header.sh
--- apertium-3.0.7+1.old/apertium/gen-wlist-lextor-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/gen-wlist-lextor-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,4 +1,4 @@
-
+#! /bin/sh
if [ $# != 2 ]
then echo "USAGE: $(basename $0) <input_file> <output_file>" 1>&2
echo "where <input_file> is a lextor monolingual dictionary (.dix) file" 1>&2
diff -urN apertium-3.0.7+1.old/apertium/modes-header.sh apertium-3.0.7+1/apertium/modes-header.sh
--- apertium-3.0.7+1.old/apertium/modes-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/modes-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,4 +1,4 @@
-
+#! /bin/sh
if [ $# -lt 1 ]
then echo "USAGE: $(basename $0) <modes file> ";
exit 1;
diff -urN apertium-3.0.7+1.old/apertium/preprocess-corpus-lextor.sh apertium-3.0.7+1/apertium/preprocess-corpus-lextor.sh
--- apertium-3.0.7+1.old/apertium/preprocess-corpus-lextor.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/preprocess-corpus-lextor.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,4 +1,4 @@
-
+#! /bin/sh
if [ $# != 4 ]
then echo "USAGE: $(basename $0) <dada_dir> <translation_dir> <input_file> <output_file>" 1>&2
echo "where <data_dir> is the path to the linguistic data to use" 1>&2
diff -urN apertium-3.0.7+1.old/apertium/transformdicbil-header.sh apertium-3.0.7+1/apertium/transformdicbil-header.sh
--- apertium-3.0.7+1.old/apertium/transformdicbil-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/transformdicbil-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,3 +1,4 @@
+#! /bin/sh
if [ $# != 2 ]
then echo "USAGE: $(basename $0) <input_file> <output_file>";
exit 1;
diff -urN apertium-3.0.7+1.old/apertium/transformdic-header.sh apertium-3.0.7+1/apertium/transformdic-header.sh
--- apertium-3.0.7+1.old/apertium/transformdic-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/transformdic-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,3 +1,4 @@
+#! /bin/sh
if [ $# != 3 ]
then echo "USAGE: $(basename $0) lr|rl <input_file> <output_file>";
exit 1;
diff -urN apertium-3.0.7+1.old/apertium/trans-header.sh apertium-3.0.7+1/apertium/trans-header.sh
--- apertium-3.0.7+1.old/apertium/trans-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/trans-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,3 +1,4 @@
+#! /bin/sh
case $# in
2)
DATOS=$1
diff -urN apertium-3.0.7+1.old/apertium/validate-header.sh apertium-3.0.7+1/apertium/validate-header.sh
--- apertium-3.0.7+1.old/apertium/validate-header.sh 2008-01-19 12:55:52.000000000 -0500
+++ apertium-3.0.7+1/apertium/validate-header.sh 2008-12-01 01:10:20.000000000 -0500
@@ -1,3 +1,4 @@
+#! /bin/sh
if [ $# != 1 ]
then echo "USAGE: $(basename $0) <input_file>";
exit 1;
signature.asc
Description: This is a digitally signed message part.

