[m-dev.] diff: change scripts/*.in to honour TMPDIR

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Sep 10 18:48:05 AEST 1999


Estimated hours taken: 0.25

scripts/ml.in:
scripts/mmake.in:
	Honour the TMPDIR environment, if it is set,
	rather than always using /tmp.

Workspace: /home/mercury0/fjh/mercury
Index: scripts/ml.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.64
diff -u -r1.64 ml.in
--- ml.in	1999/07/01 02:58:50	1.64
+++ ml.in	1999/09/10 08:40:14
@@ -119,6 +119,7 @@
 SHLIB_RPATH_OPT=${MERCURY_SHLIB_RPATH_OPT="@SHLIB_RPATH_OPT@"}
 SHLIB_RPATH_SEP=${MERCURY_SHLIB_RPATH_SEP="@SHLIB_RPATH_SEP@"}
 SHARED_LIBS=${MERCURY_SHARED_LIBS="@SHARED_LIBS@"}
+TMPDIR=${TMPDIR=/tmp}
 
 # On some systems (Solaris for exemple), we need libraries to be able to 
 # use sockets. The name of the needed libraries is determined by autoconf
@@ -590,7 +591,7 @@
 		# create the pipe, making sure we remove it if interrupted
 	old_umask=`umask`
 	umask 022
-	ML_TMPDIR=/tmp/ml$$
+	ML_TMPDIR=$TMPDIR/ml$$
 	PIPE=$ML_TMPDIR/pipe
 	trap 'rmdir $ML_TMPDIR >/dev/null 2>&1; exit 1' 1 2 3 13 15 
 	if mkdir $ML_TMPDIR ; then
Index: scripts/mmake.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mmake.in,v
retrieving revision 1.28
diff -u -r1.28 mmake.in
--- mmake.in	1999/07/20 03:39:18	1.28
+++ mmake.in	1999/09/10 08:39:41
@@ -68,6 +68,7 @@
 MERCURY_INT_DIR=${MERCURY_INT_DIR=@LIBDIR@/ints}
 MERCURY_DEFAULT_GRADE=${MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@}
 MKTEMP=@MKTEMP@
+TMPDIR=${TMPDIR=/tmp}
 
 MMAKE=$0
 verbose=false
@@ -181,7 +182,7 @@
 	case "$MKTEMP" in
 		"") 	old_umask=`umask`
 			umask 022
-			mmake_tmpdir=/tmp/mmake$$
+			mmake_tmpdir=$TMPDIR/mmake$$
 			tmp=$mmake_tmpdir/mmake
 			trap 'rmdir $mmake_tmpdir >/dev/null 2>&1; exit 1' \
 				1 2 3 13 15
@@ -197,7 +198,7 @@
 			;;
 		*)
 			# mktemp should give its own error message.
-			tmp=`$MKTEMP /tmp/mmake.XXXXXX` || exit 1
+			tmp=`$MKTEMP $TMPDIR/mmake.XXXXXX` || exit 1
 			trap 'status=$?; rm -f $tmp; exit $status' 0 1 2 3 13 15
 			;;
 	esac

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list