#!/bin/sh
# fontlink mode
#   link from $l (flat) to $s (hier)
mode=$1
l=/usr/local/lib/tex/fonts/pk$mode
s=/usr/local/share/texmf/fonts/pk/$mode
tmp=/tmp/FL.$$

if test ! -d $l
then
	echo make directory $l
	mkdirhier $l
fi
cat <<'EOF' > $tmp
#!/bin/sh
link() {
	if test -f $2
	then
		echo $2 exists
	else
		ln -s $1 $2
	fi
}
EOF
echo 'l='$l >> $tmp

find $s -type f -a -exec echo {} \; |\
sed -e 's+.*/\(.*\)$+link & $l/\1+' >> $tmp

sh $tmp
rm $tmp
