]> git.pld-linux.org Git - packages/gawk.git/blame - gawk-mktemp.patch
- updated to 3.1.0,
[packages/gawk.git] / gawk-mktemp.patch
CommitLineData
24a4696a
AF
1--- gawk-3.0.3.orig/awklib/eg/prog/igawk.sh
2+++ gawk-3.0.3/awklib/eg/prog/igawk.sh
3@@ -4,13 +4,16 @@
4 # Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
5 # July 1993
6
9cfb4dc1 7+igs=`mktemp ${TEMDIR:-/tmp}/ig.s.XXXXXX` || exit 1
8+ige=`mktemp ${TEMDIR:-/tmp}/ig.e.XXXXXX` || exit 1
24a4696a
AF
9+
10 if [ "$1" = debug ]
11 then
12 set -x
13 shift
14 else
15 # cleanup on exit, hangup, interrupt, quit, termination
16- trap 'rm -f /tmp/ig.[se].$$' 0 1 2 3 15
17+ trap 'rm -f $igs $ige' 0 1 2 3 15
18 fi
19
20 while [ $# -ne 0 ] # loop over arguments
21@@ -27,26 +30,26 @@
22
23 -[vF]*) opts="$opts '$1'" ;;
24
25- -f) echo @include "$2" >> /tmp/ig.s.$$
26+ -f) echo @include "$2" >> $igs
27 shift;;
28
29 -f*) f=`echo "$1" | sed 's/-f//'`
30- echo @include "$f" >> /tmp/ig.s.$$ ;;
31+ echo @include "$f" >> $igs ;;
32
33 -?file=*) # -Wfile or --file
34 f=`echo "$1" | sed 's/-.file=//'`
35- echo @include "$f" >> /tmp/ig.s.$$ ;;
36+ echo @include "$f" >> $igs ;;
37
38 -?file) # get arg, $2
39- echo @include "$2" >> /tmp/ig.s.$$
40+ echo @include "$2" >> $igs
41 shift;;
42
43 -?source=*) # -Wsource or --source
44 t=`echo "$1" | sed 's/-.source=//'`
45- echo "$t" >> /tmp/ig.s.$$ ;;
46+ echo "$t" >> $igs ;;
47
48 -?source) # get arg, $2
49- echo "$2" >> /tmp/ig.s.$$
50+ echo "$2" >> $igs
51 shift;;
52
53 -?version)
54@@ -61,19 +64,19 @@
55 shift
56 done
57
58-if [ ! -s /tmp/ig.s.$$ ]
59+if [ ! -s $igs ]
60 then
61 if [ -z "$1" ]
62 then
63 echo igawk: no program! 1>&2
64 exit 1
65 else
66- echo "$1" > /tmp/ig.s.$$
67+ echo "$1" > $igs
68 shift
69 fi
70 fi
71
72-# at this point, /tmp/ig.s.$$ has the program
73+# at this point, $igs has the program
74 gawk -- '
75 # process @include directives
76
77@@ -124,7 +127,7 @@
78 }
79 close(input[stackptr])
80 }
81-}' /tmp/ig.s.$$ > /tmp/ig.e.$$
82-eval gawk -f /tmp/ig.e.$$ $opts -- "$@"
83+}' $igs > $ige
84+eval gawk -f $ige $opts -- "$@"
85
86 exit $?
This page took 1.07333 seconds and 4 git commands to generate.