diff options
author | obrien <obrien@FreeBSD.org> | 2002-12-04 15:15:07 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-12-04 15:15:07 +0000 |
commit | 91f47f293a334517686a4f9330706abaa13430e5 (patch) | |
tree | 2d28fafa58d5258a639ec5d19c9c05bc40a6ccda /contrib/gcc/symlink-tree | |
parent | 3863f249f2b86c3c411f8cf5a17558af9c08e742 (diff) | |
parent | ef3bb1318428b8cfb1c8287f61b9b1f23f9bf0b5 (diff) | |
download | FreeBSD-src-91f47f293a334517686a4f9330706abaa13430e5.zip FreeBSD-src-91f47f293a334517686a4f9330706abaa13430e5.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r107588,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/gcc/symlink-tree')
-rwxr-xr-x | contrib/gcc/symlink-tree | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/contrib/gcc/symlink-tree b/contrib/gcc/symlink-tree new file mode 100755 index 0000000..5b18cab --- /dev/null +++ b/contrib/gcc/symlink-tree @@ -0,0 +1,53 @@ +#!/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" + +if test $# -lt 1; then + echo "symlink-tree error: Usage: symlink-tree srcdir \"ignore1 ignore2 ...\"" + exit 1 +fi + +ignore_additional=". .. CVS" + +# If we were invoked with a relative path name, adjust ${prog} to work +# in subdirs. +case ${prog} in +/* | [A-Za-z]:[\\/]*) ;; +*) prog=../${prog} ;; +esac + +# Set newsrcdir to something subdirectories can use. +case ${srcdir} in +/* | [A-Za-z]:[\\/]*) 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 |