#
# make sure there are no files in the non RCS directories
#
cleanfile=/tmp/clean$$
lockfile=/tmp/lock$$
exitcode=0

rm -f $cleanfile $lockfile

echo "Checking that the rcs directories are clean."
find /src/paws/src /src/paws/SRMTOOLS -type f ! -name "*,v" ! -name toolsupdate ! -name turninprogress -print > $cleanfile
if [ -s $cleanfile ] 
then
	echo "Files in RCS directories that should not be there:"
	cat $cleanfile
	exitcode=1
else
	echo "RCS DIRECTORIES ARE CLEAN."
fi

echo "\nChecking that their are no locked files in the rcs directories."
find /src/paws/src -type d -name "*RCS*" -print | while read i
do
	rlog -L -R $i/* >> $lockfile
done
if [ -s $lockfile ] 
then
	echo "Files checked out with LOCK in RCS directories are:"
	cat $lockfile
	exitcode=1
else
	echo "ALL RCS FILES ARE UNLOCKED."
fi

echo
rm -f $cleanfile $lockfile
exit $exitcode
