3 # lndir - create shadow link tree
5 # $XConsortium: lndir.sh,v 1.8 91/04/15 17:55:03 rws Exp $
7 # Used to create a copy of the a directory tree that has links for all
8 # non- directories (except those named RCS or SCCS). If you are
9 # building the distribution on more than one machine, you should use
12 # If your master sources are located in /usr/local/src/X and you would like
13 # your link tree to be in /usr/local/src/new-X, do the following:
15 # % mkdir /usr/local/src/new-X
16 # % cd /usr/local/src/new-X
19 USAGE="Usage: $0 fromdir [todir]"
21 if [ $# -lt 1 -o $# -gt 2 ]
38 echo "$0: $DIRTO is not a directory"
47 echo "$0: $DIRFROM is not a directory"
54 if [ `(cd $DIRFROM; pwd)` = $pwd ]
56 echo "$pwd: FROM and TO are identical!"
60 for file in `ls -af $DIRFROM`
62 if [ ! -d $DIRFROM/$file ]
64 ln -s $DIRFROM/$file .
66 if [ $file != RCS -a $file != SCCS -a $file != . -a $file != .. ]
74 *) DIRFROM=../$DIRFROM ;;
76 if [ `(cd $DIRFROM/$file; pwd)` = $pwd ]
78 echo "$pwd: FROM and TO are identical!"