OSDN Git Service

Find the links to directories by finding each link and testing it with test.
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Aug 1992 18:11:28 +0000 (18:11 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Aug 1992 18:11:28 +0000 (18:11 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1740 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fixincludes

index e621c70..8de664e 100755 (executable)
@@ -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"