blob: a636862ca57e29e5b833439831cf4a0cc175a68b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$NetBSD: patch-ad,v 1.3 2007/08/08 17:32:07 joerg Exp $
--- lib/pv.sh.orig 2007-07-05 12:41:52.000000000 +0200
+++ lib/pv.sh
@@ -30,21 +30,13 @@ fi
# executable name set in the makefile
GS_EXECUTABLE=gs
-TEMPDIR=.
PAGE=$1
shift
FILE="$1"
+TEMPFILE=`mktemp -t ${FILE}XXXXXX` || exit 1
shift
-if test -z "$TEMPDIR"; then
- TEMPDIR=/tmp
-fi
-if which mktemp >/dev/null 2>/dev/null; then
- tmpfile="`mktemp $TEMPDIR/\"$FILE\".pv.XXXXXX`"
-else
- tmpfile="$TEMPDIR/$FILE.$$.pv"
-fi
-trap "rm -rf $tmpfile" 0 1 2 15
-#dvips -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
-dvips -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
-$GS_EXECUTABLE $tmpfile
+trap "rm -rf $TEMPFILE" 0 1 2 15
+#dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $TEMPFILE
+dvips -p $PAGE -n 1 $FILE $* -o $TEMPFILE
+gs $TEMPFILE
exit 0
|