Package: antiword Version: 0.37-1 Severity: normal Tags: patch -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi, I have set my Desktop to ~/WP and thus kantiword script doesn't work anymore. Also being a Czech with UTF-8 locale, I have to use another locale, so I have introduced ~/.kde/share/config/kantiwordrc configuration file for this. Also, when I used arrays for the configuration file I switched the script from /bin/sh to /bin/bash -- I don't think there are many computers without /bin/bash anyway. Any comments? Best, Matej - -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (600, 'unstable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.16.1 Locale: LANG=cs_CZ.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8) Versions of packages antiword depends on: ii libc6 2.3.6-7 GNU C Library: Shared libraries antiword recommends no packages. - -- no debconf information -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFERQgA4J/vJdlkhKwRAsH4AJ9rI3+UaUgYDC7RLIZB07DLo9xIYgCeI9HD OBi5Vf8uhimJ1ech2K0jfXw= =7bLf -----END PGP SIGNATURE-----
--- /usr/bin/kantiword 2006-04-15 00:23:48.000000000 -0400 +++ kantiword 2006-04-18 11:12:00.000000000 -0400 @@ -1,8 +1,17 @@ -#!/bin/sh +#!/bin/bash # # Script to make drag and drop in KDE possible -#set -x +# set -x # +CONFS=($(kde-config --path config | tr ':' ' ')) +CONFDIR=$HOME/${CONFS#$HOME/} +CONF_FILE=${CONFDIR%/}/kantiwordrc + +if [ -r $CONF_FILE ]; then + ENCODING=$(grep encoding $CONF_FILE | tr -d '[:blank:]' | cut -d '=' -f 2) +fi + +DESKTOP=$(kde-config --userpath desktop) if [ $# -lt 2 ] then @@ -15,7 +24,7 @@ then if [ -r /etc/papersize ] then - n=`cat /etc/papersize` + n=$(cat /etc/papersize) fi if [ x$n != "xa4" ] && [ x$n != "xletter" ] then @@ -28,9 +37,9 @@ read n fi if [ x$n == "xa" ] || [ x$n == "xa4" ]; then - cp -f /usr/share/antiword/kantiword.eu.desktop ~/Desktop/kantiword.desktop + cp -f /usr/share/antiword/kantiword.eu.desktop $DESKTOP/kantiword.desktop elif [ x$n == "xl" ] || [ x$n == "xletter" ]; then - cp -f /usr/share/antiword/kantiword.us.desktop ~/Desktop/kantiword.desktop + cp -f /usr/share/antiword/kantiword.us.desktop $DESKTOP/kantiword.desktop fi fi exit 0 @@ -50,9 +59,9 @@ # Try to create the temp files in a secure way if [ -x /bin/tempfile ] then - out_file=`/bin/tempfile -d "$tmp_dir" -p antiword -s ".pdf"` || exit 1 - err_file=`/bin/tempfile -d "$tmp_dir" -p antiword -s ".err"` - txt_file=`/bin/tempfile -d "$tmp_dir" -p antiword -s ".txt"` + out_file=$(/bin/tempfile -d "$tmp_dir" -p antiword -s ".pdf") || exit 1 + err_file=$(/bin/tempfile -d "$tmp_dir" -p antiword -s ".err") + txt_file=$(/bin/tempfile -d "$tmp_dir" -p antiword -s ".txt") if [ $? -ne 0 ] then rm -f "$out_file" @@ -60,9 +69,9 @@ fi elif [ -x /bin/mktemp ] then - out_file=`/bin/mktemp -q -p "$tmp_dir" antiword.pdf.XXXXXXXXX` || exit 1 - err_file=`/bin/mktemp -q -p "$tmp_dir" antiword.err.XXXXXXXXX` - txt_file=`/bin/mktemp -q -p "$tmp_dir" antiword.txt.XXXXXXXXX` + out_file=$(/bin/mktemp -q -p "$tmp_dir" antiword.pdf.XXXXXXXXX) || exit 1 + err_file=$(/bin/mktemp -q -p "$tmp_dir" antiword.err.XXXXXXXXX) + txt_file=$(/bin/mktemp -q -p "$tmp_dir" antiword.txt.XXXXXXXXX) if [ $? -ne 0 ] then rm -f "$out_file"