This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: wwwdocs/bin/preprocess
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: wwwdocs/bin/preprocess
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Date: Thu, 6 Jan 2000 23:02:43 +0100 (MET)
- cc: Jason Molenda <jsm at cygnus dot com>
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