3 # fixlinks - make symlinks in the bash source tree so that there is
4 # exactly one version of any given source file.
11 -s) shift; SRCDIR=$1 ;;
14 -*) echo "$0: $1: bad option" 1>&2
15 echo "$0: usage: $0 [-hu] [-s srcdir] [linkmap]" 1>&2
22 if [ ! -d $SRCDIR/builtins ]; then
23 echo "$0: must be run with valid -s argument or from source directory" 1>&2
28 linkfile=$SRCDIR/support/SYMLINKS
33 if [ ! -f "$linkfile" ]; then
34 echo "$0: symlink map file \`$linkfile' does not exist"
39 # if the user specified hard links, then do that. otherwise, try to use
40 # symlinks if they're present
41 if [ -n "$hardlinks" ]; then
43 elif (ln -s /dev/null /tmp/z) >/dev/null 2>&1; then
50 while read name target
58 yes) dirname=`expr "$name" ':' '^\(.*\)/[^/]*'`
59 [ -z "$dirname" ] && dirname=.
60 cp $dirname/$target $name
61 echo $target copied to $name ;;
62 *) $LN $target $name ; echo "$name -> $target" ;;