File:  [CSRG BSD Unix] / 43BSDTahoe / new / rcs / src / rcsclean.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:58 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43tahoe
BSD 4.3tahoe

#! /bin/sh
#
# RCS cleanup operation.
# $Header: /var/lib/cvsd/repos/CSRG/43BSDTahoe/new/rcs/src/rcsclean.sh,v 1.1.1.1 2018/04/24 16:12:58 root Exp $
#
# This program removes working files which are copies of the latest
# revision on the default branch of the corresponding RCS files.
# For each file given, rcsclean performs a co operation for the latest
# revision on the default branch, and compares
# the result with the working file. If the two are identical,
# the working file is deleted.
#
# A typical application in a Makefile would be:
# clean:;       rm *.o; rcsclean *.c *.o
#
# Limitation: This program doesn't work if given the name of
# an RCS file rather than the name of the working file.

PATH=/usr/new/bin:/usr/local/bin:/bin:/usr/bin:/usr/ucb
export PATH
progname=$0
if [ $# = 0 ] ; then
    echo        "usage: $progname file ..."
    echo        "removes all working files that are checked in and are unchanged"
    exit  0
fi
TMPFILE=/tmp/rcscl$$.tmp
while test $# -gt 0 ; do
    if test -f $1 ; then
	co -p -q $1 > $TMPFILE
	if [ $? = 0 ] ; then
	    cmp -s $1 $TMPFILE
	    if [ $? = 0 ] ; then
		chmod +w $1; rm -f $1; rcs -u -q $1
	    fi
	fi
    fi
    shift
done
rm -f $TMPFILE

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.