home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / rcs4.lha / rcsclean.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1993-03-03  |  1KB  |  41 lines

  1. #! /bin/sh
  2. #
  3. # RCS cleanup operation.
  4. # $Header: /arthur/src/local/bin/rcs/src/RCS/rcsclean.sh,v 1.5 86/07/03 13:09:55 jdl Exp $
  5. #
  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.
  12. #
  13. # A typical application in a Makefile would be:
  14. # clean:;       rm *.o; rcsclean *.c *.o
  15. #
  16. # Limitation: This program doesn't work if given the name of
  17. # an RCS file rather than the name of the working file.
  18.  
  19. PATH=/h0/cmds:/h0/usr/cmds::
  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
  26. fi
  27. TMPFILE=/dd/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.         attr -w $1; del $1; rcs -u -q $1
  35.         fi
  36.     fi
  37.     fi
  38.     shift
  39. done
  40. del $TMPFILE
  41.