[comp.sources.unix] v24i012: RCS source control system, Part12/12

rsalz@bbn.com (Rich Salz) (02/23/91)

Submitted-by: Adam Hammer <hammer@cs.purdue.edu>
Posting-number: Volume 24, Issue 12
Archive-name: rcs/part12

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# Contents:  man/Makefile man/ident.1 man/rcsfreeze.1 src/rcsclean.sh
# Wrapped by rsalz@litchi.bbn.com on Thu Feb 21 14:37:12 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
echo If this archive is complete, you will see the following message:
echo '          "shar: End of archive 12 (of 12)."'
if test -f 'man/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/Makefile'\"
else
  echo shar: Extracting \"'man/Makefile'\" \(574 characters\)
  sed "s/^X//" >'man/Makefile' <<'END_OF_FILE'
X# Make RCS man pages.
X
X#	$Id: Makefile,v 5.1 1990/09/14 22:26:30 hammer Exp $
X
Xinstall = install -c -m 444
X
Xall clean ::
X
Xinstall ::
X	${install} ci.1 ${DESTDIR}/usr/man/man1
X	${install} co.1 ${DESTDIR}/usr/man/man1
X	${install} ident.1 ${DESTDIR}/usr/man/man1
X	${install} merge.1 ${DESTDIR}/usr/man/man1
X	${install} rcs.1 ${DESTDIR}/usr/man/man1
X	${install} rcsdiff.1 ${DESTDIR}/usr/man/man1
X	${install} rcsintro.1 ${DESTDIR}/usr/man/man1
X	${install} rcsmerge.1 ${DESTDIR}/usr/man/man1
X	${install} rlog.1 ${DESTDIR}/usr/man/man1
X	${install} rcsfile.5 ${DESTDIR}/usr/man/man5
END_OF_FILE
  if test 574 -ne `wc -c <'man/Makefile'`; then
    echo shar: \"'man/Makefile'\" unpacked with wrong size!
  fi
  # end of 'man/Makefile'
fi
if test -f 'man/ident.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/ident.1'\"
else
  echo shar: Extracting \"'man/ident.1'\" \(1414 characters\)
  sed "s/^X//" >'man/ident.1' <<'END_OF_FILE'
X.de Id
X.ds Rv \\$3
X.ds Dt \\$4
X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
X..
X.Id $Id: ident.1,v 5.0 1990/08/22 09:09:36 eggert Exp $
X.ds r \s-1RCS\s0
X.if n .ds - \%--
X.if t .ds - \(em
X.TH IDENT 1 \*(Dt GNU
X.SH NAME
Xident \- identify files
X.SH SYNOPSIS
X.B ident
X[
X.B \-q
X] [
X.I file
X\&.\|.\|. ]
X.SH DESCRIPTION
X.B ident
Xsearches for all occurrences of the pattern
X.BI $ keyword : .\|.\|. $
Xin the named files or, if no file name appears, the standard input.
X.PP
XThese patterns are normally inserted automatically by the \*r command
X.BR co (1),
Xbut can also be inserted manually.
XThe option
X.B \-q
Xsuppresses
Xthe warning given if there are no patterns in a file.
X.PP
X.B ident
Xworks on text files as well as object files and dumps.
XFor example, if the C program in
X.B f.c
Xcontains
X.IP
X\f3char rcsid[] = \&"$\&Id: f.c,v \*(iD $\&";\fP
X.LP
Xand
X.B f.c
Xis compiled into
X.BR f.o ,
Xthen the command
X.IP
X.B "ident  f.c  f.o"
X.LP
Xwill output
X.nf
X.IP
X.ft 3
Xf.c:
X    $\&Id: f.c,v \*(iD $
Xf.o:
X    $\&Id: f.c,v \*(iD $
X.ft
X.fi
X.SH IDENTIFICATION
XAuthor: Walter F. Tichy.
X.br
XRevision Number: \*(Rv; Release Date: \*(Dt.
X.br
XCopyright \(co 1982, 1988, 1989 by Walter F. Tichy.
X.br
XCopyright \(co 1990 by Paul Eggert.
X.SH "SEE ALSO"
Xci(1), co(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1),
Xrcsfile(5)
X.br
XWalter F. Tichy,
X\*r\*-A System for Version Control,
X.I "Software\*-Practice & Experience"
X.BR 15 ,
X7 (July 1985), 637-654.
END_OF_FILE
  if test 1414 -ne `wc -c <'man/ident.1'`; then
    echo shar: \"'man/ident.1'\" unpacked with wrong size!
  fi
  # end of 'man/ident.1'
fi
if test -f 'man/rcsfreeze.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/rcsfreeze.1'\"
else
  echo shar: Extracting \"'man/rcsfreeze.1'\" \(1723 characters\)
  sed "s/^X//" >'man/rcsfreeze.1' <<'END_OF_FILE'
X.de Id
X.ds Rv \\$3
X.ds Dt \\$4
X..
X.Id $Id: rcsfreeze.1,v 4.4 1990/11/13 15:43:42 hammer Exp $
X.ds r \s-1RCS\s0
X.TH RCSFREEZE 1 \*(Dt GNU
X.SH NAME
Xrcsfreeze \- freeze a configuration of sources checked in under RCS
X.SH SYNOPSIS
X.B rcsfreeze
X.RI [ "name" ]
X.SH DESCRIPTION
X.B rcsfreeze
Xassigns a symbolic revision
Xnumber to a set of \*r files that form a valid configuration.
X.PP
XThe idea is to run
X.B rcsfreeze
Xeach time a new version is checked
Xin.  A unique symbolic name (\c
X.BI C_ number,
Xwhere
X.I number
Xis increased each time
X.B rcsfreeze
Xis run) is then assigned to the most
Xrecent revision of each \*r file of the main trunk.
X.PP
XAn optional
X.I name
Xargument to
X.B rcsfreeze
Xgives a symbolic name to the configuration.
XThe unique identifier is still generated
Xand is listed in the log file but it will not appear as
Xpart of the symbolic revision name in the actual \*r files.
X.PP
XA log message is requested from the user for future reference.
X.PP
XThe shell script works only on all \*r files at one time.
XAll changed files must be checked in already.
XRun
X.IR rcsclean (1)
Xfirst and see whether any sources remain in the current directory.
X.SH FILES
X.TP
X.B RCS/.rcsfreeze.ver
Xversion number
X.TP
X.B RCS/.rcsfreeze.log
Xlog messages, most recent first
X.SH AUTHOR
XStephan v. Bechtolsheim
X.SH "SEE ALSO"
Xco(1), rcs(1), rcsclean(1), rlog(1)
X.SH BUGS
X.B rcsfreeze
Xdoes not check whether any sources are checked out and modified.
X.PP
XAlthough both source file names and RCS file names are accepted,
Xthey are not paired as usual with RCS commands.
X.PP
XError checking is rudimentary.
X.PP
X.B rcsfreeze
Xis just an optional example shell script, and should not be taken too seriously.
XSee \s-1CVS\s0 for a more complete solution.
END_OF_FILE
  if test 1723 -ne `wc -c <'man/rcsfreeze.1'`; then
    echo shar: \"'man/rcsfreeze.1'\" unpacked with wrong size!
  fi
  # end of 'man/rcsfreeze.1'
fi
if test -f 'src/rcsclean.sh' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/rcsclean.sh'\"
else
  echo shar: Extracting \"'src/rcsclean.sh'\" \(1966 characters\)
  sed "s/^X//" >'src/rcsclean.sh' <<'END_OF_FILE'
X#! /bin/sh
X#
X# rcsclean - remove working files that are copies of the latest RCS revision
X
X#	$Id: rcsclean.sh,v 1.7 1990/11/13 15:46:17 hammer Exp $
X
X# This program removes working files which are copies of the latest
X# revision on the default branch of the corresponding RCS files.
X# For each file given, rcsclean performs a co operation for the latest
X# revision on the default branch, and compares
X# the result with the working file. If the two are identical,
X# the working file is deleted.
X#
X# A typical application in a Makefile would be:
X# clean:;       rm *.o; rcsclean *.c *.o
X#
X# Limitation: This program doesn't work if given the name of
X# an RCS file rather than the name of the working file.
X
XPATH=/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH
Xexport PATH
X
Xusage='rcsclean: usage: rcsclean file ...'
X
Xcase $1 in
X0) echo >&2 "$usage"; exit 2
Xesac
X
X_='
X'
XIFS=$_
X
Xrcs=rcs
Xrcsdiff=rcsdiff
X
Xfor i
Xdo
X	case $i in
X	-*)
X		case $i in
X		-[qr]*) rcs=$rcs$_$i
X		esac
X		rcsdiff=$rcsdiff$_$i
X		shift;;
X	*) break
X	esac
Xdone
X
Xcase $# in
X0)
X	files=
X	for file in .* *
X	do
X		case $file in
X		*,v | . | ..) ;;
X		[-+]* | *$_*) echo >&2 "rcsclean: $file: strange file name"; exit 2;;
X		*)
X			case $file in
X			'*' | '.*') [ -f "$file" ] || continue
X			esac
X			files=$files$_$file
X		esac
X	done
X	case $files in
X	?*) set $files
X	esac;;
X*)
X	case $* in
X	*$_*) echo >&2 'rcsclean: newline in arguments'; exit 2
X	esac
Xesac
X
Xremove=
Xstatus=0
X
Xfor i
Xdo
X	case $i in
X	-*)
X		case $i in
X		-[qr]*) rcs=$rcs$_$i
X		esac
X		rcsdiff=$rcsdiff$_$i;;
X	*,v)
X		echo >&2 "rcsclean: $i: cannot handle RCS file name"; exit 2;;
X	*)
X		$rcsdiff -q $i >/dev/null 2>&1
X		case $? in
X		# Ignore rcsdiff trouble (usually files that are not under RCS).
X		0) remove=$remove$_$i;;
X		1)
X			echo >&2 "rcsclean: $i: " || exit
X			status=1
X		esac
X	esac
Xdone
X
Xcase $remove in
X?*)
X	unlock=`rlog -L -R -l${LOGNAME-$USER} $remove` &&
X	case $unlock in
X	?*) $rcs -u $unlock
X	esac &&
X	rm -f $remove || status=2
Xesac
X
Xexit $status
END_OF_FILE
  if test 1966 -ne `wc -c <'src/rcsclean.sh'`; then
    echo shar: \"'src/rcsclean.sh'\" unpacked with wrong size!
  fi
  # end of 'src/rcsclean.sh'
fi
echo shar: End of archive 12 \(of 12\).
cp /dev/null ark12isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 12 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still must unpack the following archives:
    echo "        " ${MISSING}
fi
exit 0
exit 0 # Just in case...
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.