/[autoconf]/autoconf/lib/m4sugar/m4sh.m4
ViewVC logotype

Diff of /autoconf/lib/m4sugar/m4sh.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.87 by eggert, Sun Sep 1 08:24:04 2002 UTC revision 1.88 by akim, Fri Sep 27 08:20:27 2002 UTC
# Line 789  m4_define([AS_LITERAL_IF], Line 789  m4_define([AS_LITERAL_IF],
789             [$3], [$2])])             [$3], [$2])])
790    
791    
792  # AS_TMPDIR(PREFIX)  # AS_TMPDIR(PREFIX, [DIRECTORY = $TMPDIR [= /tmp]])
793  # -----------------  # -------------------------------------------------
794  # Create as safely as possible a temporary directory which name is  # Create as safely as possible a temporary directory in DIRECTORY
795  # inspired by PREFIX (should be 2-4 chars max), and set trap  # which name is inspired by PREFIX (should be 2-4 chars max), and set
796  # mechanisms to remove it.  # trap mechanisms to remove it.
797  m4_define([AS_TMPDIR],  m4_define([AS_TMPDIR],
798  [# Create a temporary directory, and hook for its removal unless debugging.  [# Create a temporary directory, and hook for its removal unless debugging.
799  $debug ||  $debug ||
# Line 803  $debug || Line 803  $debug ||
803  }  }
804    
805  # Create a (secure) tmp directory for tmp files.  # Create a (secure) tmp directory for tmp files.
806  : ${TMPDIR=/tmp}  m4_if([$2], [], [: ${TMPDIR=/tmp}])
807  {  {
808    tmp=`(umask 077 && mktemp -d -q "$TMPDIR/$1XXXXXX") 2>/dev/null` &&    tmp=`(umask 077 && mktemp -d -q "m4_default([$2], [$TMPDIR])/$1XXXXXX") 2>/dev/null` &&
809    test -n "$tmp" && test -d "$tmp"    test -n "$tmp" && test -d "$tmp"
810  }  ||  }  ||
811  {  {
812    tmp=$TMPDIR/$1$$-$RANDOM    tmp=m4_default([$2], [$TMPDIR])/$1$$-$RANDOM
813    (umask 077 && mkdir $tmp)    (umask 077 && mkdir $tmp)
814  } ||  } ||
815  {  {
816     echo "$me: cannot create a temporary directory in $TMPDIR" >&2     echo "$me: cannot create a temporary directory in m4_default([$2], [$TMPDIR])" >&2
817     AS_EXIT     AS_EXIT
818  }dnl  }dnl
819  ])# AS_TMPDIR  ])# AS_TMPDIR

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.88

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26