aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-08-01 18:11:28 +0000
committerRichard Stallman <rms@gnu.org>1992-08-01 18:11:28 +0000
commit165b39415786da06b03b0c802b1d7b1eff826d67 (patch)
tree58bd21f74aac8f9aaa31fe04e53b2f3429619a4a /gcc
parente2301a83da536afd6b5d82b748019dd48d9cabc7 (diff)
downloadgcc-165b39415786da06b03b0c802b1d7b1eff826d67.zip
gcc-165b39415786da06b03b0c802b1d7b1eff826d67.tar.gz
gcc-165b39415786da06b03b0c802b1d7b1eff826d67.tar.bz2
Find the links to directories by finding each link and testing it with test.
From-SVN: r1740
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/fixincludes19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index e621c70..8de664e 100755
--- a/gcc/fixincludes
+++ b/gcc/fixincludes
@@ -68,9 +68,24 @@ do
fi
# Find all directories under $d, relative to $d, excluding $d itself.
- files="$files `find $d -type d -print | sed '|/\.$|d'`"
+ files="$files `find $d -type d -print | \
+ sed -e '/\/\.$/d' -e '/^\.$/d'`"
+ # Find all links to directories.
+ # Using `-exec test -d' in find fails on some systems,
+ # and trying to run test via sh fails on others,
+ # so this is the simplest alternative left.
+ # First find all the links, then test each one.
+ theselinks=
$LINKS && \
- newdirs="$newdirs `find $d -type l -exec test -d '{}' \; -print`"
+ theselinks=`find $d -type l -print`
+ for d1 in $theselinks --dummy--
+ do
+ # If it is a directory, add it to $newdirs
+ if [ -d $d1 ]
+ then
+ newdirs="$newdirs $d1"
+ fi
+ done
done
files="$files $newdirs"