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 ;;
13 -*) echo "$0: $1: bad option" 1>&2
14 echo "$0: usage: $0 [-u] [-s srcdir] [linkmap]" 1>&2
21 if [ ! -d $SRCDIR/builtins ]; then
22 echo "$0: must be run with valid -s argument or from source directory" 1>&2
27 linkfile=$SRCDIR/support/SYMLINKS
32 if [ ! -f "$linkfile" ]; then
33 echo "$0: symlink map file \`$linkfile' does not exist"
38 if (ln -s /dev/null /tmp/z) >/dev/null 2>&1; then
44 while read name target
52 yes) dirname=`expr "$name" ':' '^\(.*\)/[^/]*'`
53 [ -z "$dirname" ] && dirname=.
54 cp $dirname/$target $name
55 echo $target copied to $name ;;
56 *) $LN $target $name ; echo "$name -> $target" ;;