blob: 2dcca5360f1798275aebe0759ab922e0f204a3b7 (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
diff -ur espgs-7.07.1.orig/lib/pj-gs.sh espgs-7.07.1/lib/pj-gs.sh
--- espgs-7.07.1.orig/lib/pj-gs.sh 2002-04-23 13:58:36.000000000 +0200
+++ espgs-7.07.1/lib/pj-gs.sh 2004-09-13 10:04:00.000000000 +0200
@@ -241,6 +241,7 @@
then
/usr/lib/lprcat $Nofilter $Nolabel $file PCL1 $user $dev
else
+ TEMPFILE=`mktemp -t pjXXXXXX` || exit 1
type=`file $file | sed 's/^[^:]*..//'`
case "$type" in
postscript*)
@@ -251,22 +252,22 @@
#
# gs -q -sDEVICE=paintjet -r180 -sOutputFile=- -dDISKFONTS -dNOPAUSE - < $file 2>/tmp/sh$$
- gs -q -sDEVICE=paintjet -r180 -sOutputFile=/tmp/pj$$ -dDISKFONTS -dNOPAUSE - < $file 1>2
- cat /tmp/pj$$
- rm /tmp/pj$$
+ gs -q -sDEVICE=paintjet -r180 -sOutputFile=$TEMPFILE -dDISKFONTS -dNOPAUSE - < $file 1>2
+ cat $TEMPFILE
+ rm $TEMPFILE
needff=
;;
- *) cat "$file" 2>/tmp/sh$$
+ *) cat "$file" 2>$TEMPFILE
needff=1
;;
esac
- if [ -s /tmp/sh$$ ]
+ if [ -s $TEMPFILE ]
then
# cat /tmp/sh$$ # output any errors
- cat /tmp/sh$$ 1>2 # output any errors
+ cat $TEMPFILE 1>2 # output any errors
fi
- rm -f /tmp/sh$$
+ rm -f $TEMPFILE
if [ $needff ]; then echo "\014\r\c"; fi
fi
diff -ur espgs-7.07.1.orig/lib/ps2epsi espgs-7.07.1/lib/ps2epsi
--- espgs-7.07.1.orig/lib/ps2epsi 2003-09-02 20:01:31.000000000 +0200
+++ espgs-7.07.1/lib/ps2epsi 2004-09-13 10:05:31.000000000 +0200
@@ -1,12 +1,7 @@
#!/bin/sh
# $Id: gs7.07.1-tempfile.patch,v 1.1 2004/10/07 15:14:44 lanius Exp $
-tmpfile=/tmp/ps2epsi$$
-rm -f $tmpfile
-if test -e $tmpfile; then
- echo "$0: Our temporary file $tmpfile already exists." 1>&2
- exit 1
-fi
+tmpfile=`mktemp -t ps2epsiXXXXXX` || exit 1
trap "rm -rf $tmpfile" 0 1 2 3 7 13 15
export outfile
diff -ur espgs-7.07.1.orig/lib/pv.sh espgs-7.07.1/lib/pv.sh
--- espgs-7.07.1.orig/lib/pv.sh 2002-04-23 13:58:36.000000000 +0200
+++ espgs-7.07.1/lib/pv.sh 2004-09-13 10:08:01.000000000 +0200
@@ -29,9 +29,10 @@
PAGE=$1
shift
FILE=$1
+TEMPFILE=`mktemp -t ${FILE}XXXXXX` || exit 1
shift
-trap "rm -rf $TEMPDIR/$FILE.$$.pv" 0 1 2 15
+trap "rm -rf $TEMPFILE" 0 1 2 15
#dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
-dvips -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
-gs $FILE.$$.pv
+dvips -p $PAGE -n 1 $FILE $* -o $TEMPFILE
+gs $TEMPFILE
exit 0
diff -ur espgs-7.07.1.orig/lib/sysvlp.sh espgs-7.07.1/lib/sysvlp.sh
--- espgs-7.07.1.orig/lib/sysvlp.sh 2002-04-23 13:58:37.000000000 +0200
+++ espgs-7.07.1/lib/sysvlp.sh 2004-09-13 10:14:46.000000000 +0200
@@ -27,20 +27,23 @@
# Brother HL-4: switch to HP laserjet II+ emulation
# echo "\033\015H\c"
+TEMPDIR=`mktemp -td sysvlp.XXXXXX` || exit 1
+
i=1
while [ $i -le $copies ]
do
for file in $files
do
$GSHOME/gs \
- -sOUTPUTFILE=/tmp/psp$$.%02d \
+ -sOUTPUTFILE=$TEMPDIR/psp$$.%02d \
-sDEVICE=$DEVICE \
$EHANDLER $file \
< /dev/null >> /usr/tmp/ps_log 2>&1
- cat /tmp/psp$$.* 2>> /usr/tmp/ps_log
- rm -f /tmp/psp$$.*
+ cat $TEMPDIR/psp$$.* 2>> /usr/tmp/ps_log
+ rm -f $TEMPDIR/psp$$.*
done
i=`expr $i + 1`
done
+rmdir $TEMPDIR
exit 0
|