aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-07-12 21:33:47 +0000
committerRichard Stallman <rms@gnu.org>1992-07-12 21:33:47 +0000
commitf1f1ae8efa4cdcaef5c2677f36c85ad20df5d2a3 (patch)
tree152b2f1e18d045f37494c0c3b222f8e31af94cbf
parentda968ff33f5f1305ba871321e902de9b0dea9a93 (diff)
downloadgcc-f1f1ae8efa4cdcaef5c2677f36c85ad20df5d2a3.zip
gcc-f1f1ae8efa4cdcaef5c2677f36c85ad20df5d2a3.tar.gz
gcc-f1f1ae8efa4cdcaef5c2677f36c85ad20df5d2a3.tar.bz2
Replace the code that finds all directories
so that it looks for subdirs of dir reached via symlinks. From-SVN: r1579
-rwxr-xr-xgcc/fixincludes34
1 files changed, 32 insertions, 2 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index 21e5fc7..8ccd05b 100755
--- a/gcc/fixincludes
+++ b/gcc/fixincludes
@@ -44,8 +44,38 @@ fi
echo 'Making directories:'
cd ${INPUT}
# Find all directories and all symlinks that point to directories.
-files=` find . -type d -print | sed '/^.$/d'
- $LINKS && find . -type l -exec test -d '{}' \; -print`
+# Put the list in $files.
+# Each time we find a symlink, add it to newdirs
+# so that we do another find within the dir the link points to.
+# Note that $files may have duplicates in it;
+# later parts of this file are supposed to ignore them.
+dirs="."
+prevdirs="."
+while [ -n "$dirs" ]
+do
+ newdirs=
+ for d in $prevdirs
+ do
+ if [ "$d" != . ]
+ then
+ d=$d/.
+ fi
+
+ # Find all directories under $d, relative to $d, including $d itself.
+ # Get rid of ./ at the end!
+ files="$files `find $d -type d -print | sed '/^.$/d' | sed '/\/\.$/ s|/\.$||'`"
+ $LINKS && \
+ newdirs="$newdirs `find $d -type l -exec test -d '{}' \; -print`"
+ done
+
+ dirs="$newdirs"
+ prevdirs="$newdirs"
+done
+
+dirs=
+echo all directories:
+echo $files
+
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]