diff --git a/rcstell/GNUmakefile b/rcstell/GNUmakefile new file mode 100644 index 0000000..c8beb65 --- /dev/null +++ b/rcstell/GNUmakefile @@ -0,0 +1,24 @@ +include GNUmakerules +include GNUmakevars + +count: + +install: $(ROOT)/usr/local/bin/rcstell \ + $(ROOT)/usr/local/bin/rcsinfo \ + + +install_all: + $(MAKE) install ROOT=/nfs/wsrdb + $(MAKE) install ROOT=/nfs/wsrcom + $(MAKE) install ROOT=/nfs/wifosv + $(MAKE) install ROOT=/nfs/ihssv + $(MAKE) install ROOT=/nfs/wsrtest + +$(ROOT)/usr/local/bin/rcsinfo: $(ROOT)/usr/local/bin/rcstell + ln -s $< $@ + +$(ROOT)/usr/local/man/man8/%.8: %.man + $(INSTALL) $< $@ + +clean: + rm count diff --git a/rcstell/rcstell b/rcstell/rcstell new file mode 100755 index 0000000..ffadf28 --- /dev/null +++ b/rcstell/rcstell @@ -0,0 +1,55 @@ +#!/bin/sh + +if [ $# -gt 1 ] +then + echo "Usage is: $0 [directory]" >&2 + exit 1 +fi + +NAME=`basename $0` + +if [ $# -eq 1 ] +then + DIR=`echo "$1" | sed -e 's+/RCS/*$++'` + cd "$DIR" +fi + +if [ ! -d RCS ] +then + echo "$0: no RCS directory" >&2 + exit 2 +fi + +OIFS="$IFS" +IFS=' +' +ALLFILES=`ls RCS/* | sed -e 's+^RCS/\(.*\),v+\1+'` +FILES=`grep '^locks$' /dev/null RCS/* | sed -e 's+^RCS/\(.*\),v:locks+\1+'` +FILEDIFF=`( echo "$ALLFILES"; echo "$FILES" ) | sort | uniq -u` + +for I in $FILES +do + IFS=${OIFS}:';' + set `awk '/^locks/,/;$/ { print }' RCS/${I},v` + LOCKER=$2 + VERSION=$3 + case "$NAME" + in + rcsinfo) echo "$I: version $VERSION locked by $LOCKER" ;; + rcstell) echo $I ;; + *) echo "Internal error: command $NAME unknown" >&2 + exit 1 + ;; + esac +done +IFS=' +' +for I in $FILEDIFF +do + case "$NAME" + in + rcsinfo) echo $I;; + esac +done + +exit 0