Don't use .Xo/.Xc. Fix date format.
[netbsd-mini2440.git] / usr.bin / rcs / src / rcsclean.sh
blobf3d0e197ada3759c4a259681351f91d2258e3cf0
1 #! /bin/sh
3 # RCS cleanup operation.
4 # $Header: /pub/NetBSD/misc/repositories/cvsroot/src/usr.bin/rcs/src/Attic/rcsclean.sh,v 1.1 1993/03/21 09:58:07 cgd Exp $
6 # This program removes working files which are copies of the latest
7 # revision on the default branch of the corresponding RCS files.
8 # For each file given, rcsclean performs a co operation for the latest
9 # revision on the default branch, and compares
10 # the result with the working file. If the two are identical,
11 # the working file is deleted.
13 # A typical application in a Makefile would be:
14 # clean:; rm *.o; rcsclean *.c *.o
16 # Limitation: This program doesn't work if given the name of
17 # an RCS file rather than the name of the working file.
19 PATH=/usr/new/bin:/usr/local/bin:/bin:/usr/bin:/usr/ucb
20 export PATH
21 progname=$0
22 if [ $# = 0 ] ; then
23 echo "usage: $progname file ..."
24 echo "removes all working files that are checked in and are unchanged"
25 exit 0
27 TMPFILE=/tmp/rcscl$$.tmp
28 while test $# -gt 0 ; do
29 if test -f $1 ; then
30 co -p -q $1 > $TMPFILE
31 if [ $? = 0 ] ; then
32 cmp -s $1 $TMPFILE
33 if [ $? = 0 ] ; then
34 chmod +w $1; rm -f $1; rcs -u -q $1
38 shift
39 done
40 rm -f $TMPFILE