diff options
author | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-08-01 18:11:28 +0000 |
---|---|---|
committer | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-08-01 18:11:28 +0000 |
commit | 5321024dac9a25eda9ee172943c3ae2deeadc79c (patch) | |
tree | 58bd21f74aac8f9aaa31fe04e53b2f3429619a4a /gcc | |
parent | 87994a83abb356c1ce23a3b12861f6efc1a9b8df (diff) | |
download | gcc-5321024dac9a25eda9ee172943c3ae2deeadc79c.tar.gz |
Find the links to directories by finding each link and testing it with test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1740 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rwxr-xr-x | gcc/fixincludes | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes index e621c70c07c..8de664e87e3 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" |