#! /bin/sh
# $Revision: 1.3 $

# this is somewhat gross, to say the least.  The idea is that each font
# family directory has all the same files in it, but the 4 standard fonts
# are different for each family (and therefore DESC.out).  So we install
# all into /usrlib/font/devpsc,  install the uniq ones into each family,
# then at install time link all the non-uniq fonts via a postop that
# invokes this script.
# the first argument is the name of the 'root' directory, 2nd arg is
# the name of the Transcript font tree, remaining
# arguments are the dirs in which we make links
# typically invoked as:
# sh linkfamily /root /usr/lib/ps/ditroff.font AvanteGarde Times ...
root=$1
ditdir=$2
shift 2
cd $root/usr/lib/font/devpsc
files="`echo * | tr -s ' ' '\012' | egrep -v '^([RIB]|[RIB].*|BI|BI.*|DESC.out)$'`"
for ff in $@
do
	ln -f $files $root/$ditdir/$ff/devpsc 2>&1 | grep -v identical
done

# otherwise exit with status of grep, which will be non-zero if
# we are re-installing
exit 0
	
