: Utility to make a tree of symbolic links to source tree.
: Mount the source tree read-only, use this script, and then try installation.
case $# in
2)	;;
*)	echo "Usage: $0 <source-tree> <symlink-tree>" 1>&2
	exit 1
	;;
esac
if [ -f $1/.distr ]
then
	for i in `cat $1/.distr`
	do
		if [ -d $1/$i ]
		then
			if mkdir $2/$i && $0 $1/$i $2/$i
			then
				:
			else
				exit 2
			fi
		else
			if [ -f $1/$i ] 
			then
				if ln -s $1/$i $2/$i
				then
					:
				else
					exit 3
				fi
			else
				echo "Missing file $1/$i" 1>&2
				exit 4
			fi
		fi
	done
else
	echo "No .distr file in $1" 1>&2
	exit 5
fi
