:
#	@(#) idvidi 23.2 91/03/03 
#
#	Copyright (C) 1989-1991 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#
#
#	idvidi: Shell script to take a sdev and mvdev and
#	make the appropriate information available in
#	the /etc/conf/ directories.
#

case $1 in
	"-r")
		ID=$2 ;;
	"")
		;;
	*)
		echo "Usage: $0 [-r ID]"
		exit 1
		;;
esac

VDIR=${ID}/pack.d/cn
VIDI=${VDIR}/vidimaster
rm -f ${VDIR}/space.c $VIDI

MVDEV=${ID}/cf.d/mvdevice
SDEV=${ID}/sdevice.d

for i in `sed 's/[	 ].*$//' $MVDEV`
do
	grep '^'$i'[	 ]*Y' $SDEV/$i > /dev/null \
		&& grep '^'$i $MVDEV >> $VIDI
done

cd ${VDIR}
$ID/bin/idvdbuild $VIDI
rm -rf $VIDI
