This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: wwwdocs/bin/preprocess


We'll need a couple of temp files soon, so...

  Create (and properly) remove a directory where we will put temp files.

Thanks to Jason M. and Jeff for their hints on how to do that!

Gerald

Index: preprocess
===================================================================
RCS file: /cvs/gcc/wwwdocs/bin/preprocess,v
retrieving revision 1.1
diff -c -3 -p -r1.1 preprocess
*** preprocess	1999/12/29 16:30:42	1.1
--- preprocess	2000/01/06 21:59:05
*************** if [ ! -d $DESTTREE ]; then
*** 27,34 ****
--- 27,49 ----
  fi
  
  ####
+ # Good guys clean after them.
+ 
+ TMPDIR=/tmp/$0.$$
+ 
+ echo "Using $TMPDIR"
+ 
+ cleanup() {
+     rm -rf $TMPDIR $1
+ }
+ 
+ trap "cleanup; exit 1" 0 1 2 15 
+ 
+ ####
  # Process all files in the source tree, excluding files/directories called CVS.
  
+ mkdir $TMPDIR
+  
  cd $SOURCETREE
  
  for f in `find . \( -name CVS -prune \) -o -type f` ; do


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]