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

#
#		L i s t   i n f o r m a t i o n
#	Prints three lines of information for each of its arguments,
#	one for the user file (line 1), one for the newest RCS file
#	(line 3) and one for the RCS file both derive from (line 2).
#
#	If the option -l is given, each report will be followed by
#	the log of the the file as kept by RCS.
#
Name=LS; 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

# determine the name of the repository
Repository=""
. $CVSLIB/NR.aux

# get possible options
. $CVSLIB/OP.aux			# sets $Options

# check option
case "$Options" in
""|" -l")
	# OK
	;;
*)
	echo Call is: $Name \[ -l \] filename ... >&2
	exit 1
	;;
esac

# determine the way we are called
case $# in
0)
	# no file names: all pertinent files
	set "`$CVSLIB/FN.aux $Repository`"
	;;
esac

for User in $@
do
	. $CVSLIB/LR.aux	# sets $Rcs to $Repository/$User,v or /Attic/
	. $CVSLIB/VT.aux	# sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
	. $CVSLIB/HN.aux	# sets $HN_User
	
	case "$TS_User" in
	"")
		echo "User:	no user file $User"
		;;
	*)
		echo "User:	$HN_User	$TS_User"
		;;
	esac
	
	case $VN_User in
	"")
		echo "From:	no entry for $User"
		;;
	0)
		# a new file
		echo "From:	new	message: `<$User,t sed '1!d'`"
		;;
	*)
		echo "From:	$VN_User	$TS_Rcs"
		;;
	esac
	
	case $VN_Rcs in
	"")
		echo "RCS:	no $Rcs"
		;;
	*)
		echo "RCS:	$VN_Rcs	$Rcs"
		;;
	esac
	
	if	# RCS log requested
		[ "$Options" = " -l" ]
	then
		$RCSBIN/rlog $Rcs
	fi
	echo ''
done
