aboutsummaryrefslogtreecommitdiff
path: root/print/a2ps/files/patch-contrib-tmpdircreation
blob: b975735d7df3fd33cb24e9118d4cf40710495bba (plain) (blame)
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
diff -ru contrib.orig/card.in contrib/card.in
--- contrib.orig/card.in	2000-01-27 00:42:36 UTC
+++ contrib/card.in
@@ -38,7 +38,7 @@
 LC_ALL="${LC_ALL-C}" export LC_ALL
 print_form_feeds=:
 RM="/bin/rm -rf"
-tmp_dir=${TMPDIR-/tmp}/$program.$$
+tmp_dir=$(mktemp -d -t ${program}) || exit 1
 tmp_file=$tmp_dir/card
 success=false
 verbose=:
@@ -190,7 +190,6 @@
 
 # Create a tmp dir and be ready to clean up
 trap "$RM $tmp_dir" 0 1 2 15
-(umask 077 && mkdir $tmp_dir) || exit 1
 
 case $LC_ALL in
   fr) footer="Engendré par $version_short" ;;
diff -ru contrib.orig/pdiff.in contrib/pdiff.in
--- contrib.orig/pdiff.in	1999-10-24 15:07:51 UTC
+++ contrib/pdiff.in
@@ -34,7 +34,7 @@
 diff_options='-u'
 file=
 output=
-tmpdir=/tmp/$program.$$
+tmpdir=$(mktemp -d -t ${program}) || exit 1
 verbose=echo
 wdiff_prog=${WDIFF:-wdiff}
 wdiff_options='-w[wd- -x-wd] -y{wd+ -z+wd}'
diff -ru contrib.orig/psmandup.in contrib/psmandup.in
--- contrib.orig/psmandup.in	1999-10-24 13:06:42 UTC
+++ contrib/psmandup.in
@@ -36,7 +36,7 @@
 message=
 psselect=${PSSELECT:-psselect}
 psset=${PSSET:-psset}
-tmpdir=/tmp/$program.$$
+tmpdir=$(mktemp -d -t ${program}) || exit 1
 
 # These two must be kept in synch.  They are opposed.
 verbose=echo
@@ -184,8 +184,6 @@
   # Temp dir.  Get ready not to leave junk (if not debugging)
   trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
 fi
-
-mkdir $tmpdir
 
 # If printing from stdin, save into a tmp file
 if test $file = '-'; then
diff -ru contrib.orig/psset.in contrib/psset.in
--- contrib.orig/psset.in	1999-10-24 12:41:46 UTC
+++ contrib/psset.in
@@ -33,7 +33,7 @@
 output=-
 pagedevices=	# `;' separated list of `key:value'
 quiet=:         # i.e., verbose
-tmpdir=${TMPDIR:-/tmp}/$program.$$
+tmpdir=$(mktemp -d -t ${program}) || exit 1
 sedscript=$tmpdir/psset.sed
 
 # The version/usage strings
@@ -185,8 +185,6 @@
       echo "$help"  1>&2
       exit 1;;
 esac
-
-mkdir $tmpdir
 
 if test -n "$debug"; then
   # Set -x now if debugging
diff -ru contrib.orig/texi2dvi4a2ps contrib/texi2dvi4a2ps
--- contrib.orig/texi2dvi4a2ps	2000-02-24 17:45:31 UTC
+++ contrib/texi2dvi4a2ps
@@ -91,7 +91,7 @@
 quiet=          # by default let the tools' message be displayed
 set_language=
 textra=
-tmpdir=${TMPDIR:-/tmp}/t2d$$  # avoid collisions on 8.3 filesystems.
+tmpdir=$(mktemp -d -t ${program}) || exit 1
 txincludes=     # TEXINPUTS extensions
 txiprereq=19990129 # minimum texinfo.tex version to have macro expansion
 verbose=false   # echo for verbose mode
@@ -202,9 +202,6 @@
 if test -z "$debug"; then
   trap "cd / && rm -rf $tmpdir" 0 1 2 15
 fi
-
-# Create the temporary directory with strict rights
-(umask 077 && mkdir $tmpdir) || exit 1
 
 # Prepare the tools we might need.  This may be extra work in some
 # cases, but improves the readibility of the script.