diff options
Diffstat (limited to 'odftops-filter/odftops')
-rwxr-xr-x[-rw-r--r--] | odftops-filter/odftops | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/odftops-filter/odftops b/odftops-filter/odftops index cc63c22..9593e66 100644..100755 --- a/odftops-filter/odftops +++ b/odftops-filter/odftops @@ -9,11 +9,9 @@ fn="$6" #for our subshell convenience -sandbox1="${TMPDIR1:-/tmp}/tempcups.$$" -(umask 077 && mkdir "$sandbox1") || exit 1 - - # we are creating a dummy folder, which can take different file types. +sandbox1="${TMPDIR1:-/tmp}/cups-temp.$$" +(umask 077 && mkdir "$sandbox1") || exit 1 sandbox="${TMPDIR:-/tmp}/cups-odftops.$$" (umask 077 && mkdir "$sandbox") || exit 1 @@ -21,8 +19,7 @@ sandbox="${TMPDIR:-/tmp}/cups-odftops.$$" #The condition which checks whether our abiword is 2.6.6+ or 2.6.6- -$(abiword --to="$sandbox1/temp123.doc" "$fn") - +`abiword --to="$sandbox1/temp123.doc" "$fn"` > "$sandbox/errorinfo.txt" if [ "$?" -ne 0 ]; then @@ -37,30 +34,28 @@ then abiword --to="ps" "$fn1" - fn2="`echo "$fn1" | sed -e 's/odt$/ps/' `" - + fn2="$sandbox/temp123.ps" else #check if our version doesn't require an intermediate conversion, #if it does, do it - $(abiword --to="$sandbox1/temp123.ps" "$fn") + `abiword --to="$sandbox1/temp123.ps" "$fn"` > "$sandbox/errorinfo.txt" if [ "$?" -ne 0 ]; then - + abiword --to="$sandbox/temp123.ps" "$sandbox1/temp123.doc" - + fn2="$sandbox/temp123.ps" + else - - fn2="$sandbox1/temp123.ps" - fi - + fn2="$sandbox1/temp123.ps" + fi fi cat "$fn2" #remove the sandbox folder, for debugging purposes check by commenting the following line and see what is in the /tmp/ folder rm -rf $sandbox -rm -rf $sandbox1 +rm -rf $sandbox1
\ No newline at end of file |