[m-rev.] diff: improvements to cvdd

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Jul 16 13:40:47 AEST 2002


tools/cvdd:
	Make the script exit cleanly if interrupted, and add some
	bulletproofing.

Zoltan.

cvs diff: Diffing .
Index: cvdd
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/cvdd,v
retrieving revision 1.4
diff -u -b -r1.4 cvdd
--- cvdd	2001/11/19 01:18:19	1.4
+++ cvdd	2002/07/16 03:31:12
@@ -37,6 +37,12 @@
 	exit 1
 fi
 
+if test ! -d "$1" -o ! -d "$2"
+then
+	echo "usage: cvdd dir1 dir2"
+	exit 1
+fi
+
 case "$pathname" in
 ./*)
 	pathname=`expr $pathname : '\./\(.*\)'`
@@ -47,7 +53,8 @@
 
 filelist="/tmp/cvdd_files$$"
 dirlist="/tmp/cvdd_dirs$$"
-trap "/bin/rm -f $filelist $dirlist > /dev/null 2>&1" 0 1 2 3 15
+trap "/bin/rm -f $filelist $dirlist > /dev/null 2>&1; exit 0" 0
+trap "/bin/rm -f $filelist $dirlist > /dev/null 2>&1; exit 1" 1 2 3 15
 
 (
 	cvsfiles $1
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list