#!/bin/sh
#	This file is part of the Concurrent Versions System CVS.
#	Written by Dick Grune, Vrije Universiteit, Amsterdam.
#	$Header: LAR,v 3.1 89/09/25 16:32:08 dick Exp $

#
#		L i s t   A l l   R e p o s i t o r i e s
#	LAR <directory> lists all repositories that are subdirectories of
#	<directory>, according to the criterion that a repository contains RCS
#	files and that it is not named Attic or Admin.
#
Name=LAR; export Name

# CVSBIN, CVSLIB and RCSBIN directories
CVSBIN=/home/top/dick/cvs
CVSLIB=/home/top/dick/cvs
RCSBIN=${RCSBIN-/usr/local/bin}
export CVSBIN CVSLIB RCSBIN

# avoid spurious identifications
PATH=${CVSPATH-/bin:/usr/bin}; export PATH

DIR=$1
case "$DIR" in
"")
	echo Call is: $Name directory >&2
	exit 1
	;;
esac
shift

find $DIR -type d -a -print |
while	read Repository
do
	BASENAME=`basename $Repository`
	if	# this is definitely not a repository
		[ "$BASENAME" = Admin -o "$BASENAME" = Attic ]
	then	# skip it
		:
	elif	# this is definitely a repository
		[ -d $Repository/Admin -o -d $Repository/Attic \
		-o "`echo $Repository/*,v`" != "$Repository/*,v" \
		-o "`echo $Repository/.*,v`" != "$Repository/.*,v" \
		]
	then	# report it
		echo $Repository
	else	# we suppose it isn't
		:
	fi
done

exit 0
