diff options
author | Jeff Law <law@redhat.com> | 1998-11-11 05:47:47 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1998-11-11 05:47:47 +0000 |
commit | 1e490350fff9619fd30dbea910412308eb7c8661 (patch) | |
tree | 7a2feb269e9e69c21c59fd25f58ae460bc64cf9e /symlink-tree | |
parent | 10b2757be5c6b726a2e8b00d8eed80b9bca95369 (diff) | |
download | gdb-1e490350fff9619fd30dbea910412308eb7c8661.zip gdb-1e490350fff9619fd30dbea910412308eb7c8661.tar.gz gdb-1e490350fff9619fd30dbea910412308eb7c8661.tar.bz2 |
dummy commit before egcs merge
Diffstat (limited to 'symlink-tree')
-rwxr-xr-x | symlink-tree | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/symlink-tree b/symlink-tree new file mode 100755 index 0000000..096582d --- /dev/null +++ b/symlink-tree @@ -0,0 +1,48 @@ +#!/bin/sh +# Create a symlink tree. +# +# Syntax: symlink-tree srcdir "ignore1 ignore2 ..." +# +# where srcdir is the directory to create a symlink tree to, +# and "ignoreN" is a list of files/directories to ignore. + +prog=$0 +srcdir=$1 +ignore="$2" + +ignore_additional=". .. CVS" + +# If we were invoked with a relative path name, adjust ${prog} to work +# in subdirs. +case ${prog} in +/*) ;; +*) prog=../${prog} ;; +esac + +# Set newsrcdir to something subdirectories can use. +case ${srcdir} in +/*) newsrcdir=${srcdir} ;; +*) newsrcdir=../${srcdir} ;; +esac + +for f in `ls -a ${srcdir}`; do + if [ -d ${srcdir}/$f ]; then + found= + for i in ${ignore} ${ignore_additional}; do + if [ "$f" = "$i" ]; then + found=yes + fi + done + if [ -z "${found}" ]; then + echo "$f ..working in" + if [ -d $f ]; then true; else mkdir $f; fi + (cd $f; ${prog} ${newsrcdir}/$f "${ignore}") + fi + else + echo "$f ..linked" + rm -f $f + ln -s ${srcdir}/$f . + fi +done + +exit 0 |