URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 58 |
Rev 1765 |
#!/bin/sh
|
#!/bin/sh
|
# Create a symlink tree.
|
# Create a symlink tree.
|
#
|
#
|
# Syntax: symlink-tree srcdir "ignore1 ignore2 ..."
|
# Syntax: symlink-tree srcdir "ignore1 ignore2 ..."
|
#
|
#
|
# where srcdir is the directory to create a symlink tree to,
|
# where srcdir is the directory to create a symlink tree to,
|
# and "ignoreN" is a list of files/directories to ignore.
|
# and "ignoreN" is a list of files/directories to ignore.
|
|
|
prog=$0
|
prog=$0
|
srcdir=$1
|
srcdir=$1
|
ignore="$2"
|
ignore="$2"
|
|
|
ignore_additional=". .. CVS"
|
ignore_additional=". .. CVS"
|
|
|
# If we were invoked with a relative path name, adjust ${prog} to work
|
# If we were invoked with a relative path name, adjust ${prog} to work
|
# in subdirs.
|
# in subdirs.
|
case ${prog} in
|
case ${prog} in
|
/*) ;;
|
/*) ;;
|
*) prog=../${prog} ;;
|
*) prog=../${prog} ;;
|
esac
|
esac
|
|
|
# Set newsrcdir to something subdirectories can use.
|
# Set newsrcdir to something subdirectories can use.
|
case ${srcdir} in
|
case ${srcdir} in
|
/*) newsrcdir=${srcdir} ;;
|
/*) newsrcdir=${srcdir} ;;
|
*) newsrcdir=../${srcdir} ;;
|
*) newsrcdir=../${srcdir} ;;
|
esac
|
esac
|
|
|
for f in `ls -a ${srcdir}`; do
|
for f in `ls -a ${srcdir}`; do
|
if [ -d ${srcdir}/$f ]; then
|
if [ -d ${srcdir}/$f ]; then
|
found=
|
found=
|
for i in ${ignore} ${ignore_additional}; do
|
for i in ${ignore} ${ignore_additional}; do
|
if [ "$f" = "$i" ]; then
|
if [ "$f" = "$i" ]; then
|
found=yes
|
found=yes
|
fi
|
fi
|
done
|
done
|
if [ -z "${found}" ]; then
|
if [ -z "${found}" ]; then
|
echo "$f ..working in"
|
echo "$f ..working in"
|
if [ -d $f ]; then true; else mkdir $f; fi
|
if [ -d $f ]; then true; else mkdir $f; fi
|
(cd $f; ${prog} ${newsrcdir}/$f "${ignore}")
|
(cd $f; ${prog} ${newsrcdir}/$f "${ignore}")
|
fi
|
fi
|
else
|
else
|
echo "$f ..linked"
|
echo "$f ..linked"
|
rm -f $f
|
rm -f $f
|
ln -s ${srcdir}/$f .
|
ln -s ${srcdir}/$f .
|
fi
|
fi
|
done
|
done
|
|
|
exit 0
|
exit 0
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.