diff -ur autoconf-2.13~/autoconf.sh autoconf-2.13/autoconf.sh --- autoconf-2.13~/autoconf.sh Tue Jan 5 16:27:53 1999 +++ autoconf-2.13/autoconf.sh Thu Aug 23 15:09:45 2001 @@ -45,7 +45,19 @@ esac : ${TMPDIR=/tmp} -tmpout=${TMPDIR}/acout.$$ +TMPDIR="$(mktemp -d "$TMPDIR/autoconf.XXXXXX")" || exit + +exit_handler() +{ + status=$? + trap '' EXIT + rm -rf "$TMPDIR" + exit $status +} + +trap exit_handler EXIT SIGHUP SIGPIPE SIGINT SIGTERM + +tmpout=${TMPDIR}/tmpout localdir= show_version=no @@ -95,12 +107,9 @@ *) echo "$usage" >&2; exit 1 ;; esac -trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 - -tmpin=${TMPDIR}/acin.$$ # Always set this, to avoid bogus errors from some rm's. +tmpin=${TMPDIR}/tmpin # Always set this, to avoid bogus errors from some rm's. if test z$infile = z-; then infile=$tmpin - cat > $infile elif test ! -r "$infile"; then echo "autoconf: ${infile}: No such file or directory" >&2 exit 1 @@ -118,11 +127,10 @@ case `$M4 --help < /dev/null 2>&1` in *reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;; *traditional*) ;; -*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; +*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;; esac -$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || - { rm -f $tmpin $tmpout; exit 2; } +$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || exit 2 # You could add your own prefixes to pattern if you wanted to check for # them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do @@ -153,7 +161,5 @@ ' $tmpout | sed ' /__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/ ' >&4 - -rm -f $tmpout exit $status diff -ur autoconf-2.13~/autoheader.sh autoconf-2.13/autoheader.sh --- autoconf-2.13~/autoheader.sh Tue Jan 5 16:28:39 1999 +++ autoconf-2.13/autoheader.sh Thu Aug 23 15:01:45 2001 @@ -27,6 +27,19 @@ Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir] [-l dir] [--localdir=dir] [--version] [template-file]" +: ${TMPDIR=/tmp} +TMPDIR="$(mktemp -d "$TMPDIR/autoheader.XXXXXX")" || exit + +exit_handler() +{ + status=$? + trap '' EXIT + rm -rf "$TMPDIR" + exit $status +} + +trap exit_handler EXIT SIGHUP SIGPIPE SIGINT SIGTERM + # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). @@ -140,8 +153,7 @@ syms="`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`" if test $# -eq 0; then - tmpout=autoh$$ - trap "rm -f $tmpout; exit 1" 1 2 15 + tmpout=${TMPDIR}/tmpout exec > $tmpout fi @@ -194,8 +206,7 @@ # Some fgrep's have limits on the number of lines that can be in the # pattern on the command line, so use a temporary file containing the # pattern. - (fgrep_tmp=${TMPDIR-/tmp}/autoh$$ - trap "rm -f $fgrep_tmp; exit 1" 1 2 15 + (fgrep_tmp=${TMPDIR-/tmp}/fgrep_tmp cat > $fgrep_tmp <&2 exit 1 fi @@ -109,5 +120,4 @@ mv $tmpout configure.in ;; esac -rm -f $sedtmp $tmpout exit 0