Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1999-05-03 11:29:06 +0400
committerRichard Henderson <rth@redhat.com>1999-05-03 11:29:06 +0400
commita3acbf46947e52ff596461a4cf6f539884c9dbbd (patch)
treeef93cefb82fdb4d8f2639e166e277474d9b2acab /symlink-tree
19990502 sourceware importbinu_ss_19990502
Diffstat (limited to 'symlink-tree')
-rwxr-xr-xsymlink-tree48
1 files changed, 48 insertions, 0 deletions
diff --git a/symlink-tree b/symlink-tree
new file mode 100755
index 000000000..096582db6
--- /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