Commit fd297e33 by Richard Stallman

Don't repeat the directory-link-chasing loop more than twice.

Combine $prevdirs with $dirs--they had same value.
Properly discard $d itself from the output of find.

From-SVN: r1712
parent ef57b1e9
...@@ -55,26 +55,25 @@ cd ${INPUT} ...@@ -55,26 +55,25 @@ cd ${INPUT}
# Note that $files may have duplicates in it; # Note that $files may have duplicates in it;
# later parts of this file are supposed to ignore them. # later parts of this file are supposed to ignore them.
dirs="." dirs="."
prevdirs="." levels=2
while [ -n "$dirs" ] while [ -n "$dirs" ] && [ $levels -gt 0 ]
do do
levels=`expr $levels - 1`
newdirs= newdirs=
for d in $prevdirs for d in $dirs
do do
if [ "$d" != . ] if [ "$d" != . ]
then then
d=$d/. d=$d/.
fi fi
# Find all directories under $d, relative to $d, including $d itself. # Find all directories under $d, relative to $d, excluding $d itself.
# Get rid of ./ at the end! files="$files `find $d -type d -print | sed '|/\.$|d'`"
files="$files `find $d -type d -print | sed '/^.$/d' | sed '/\/\.$/ s|/\.$||'`"
$LINKS && \ $LINKS && \
newdirs="$newdirs `find $d -type l -exec test -d '{}' \; -print`" newdirs="$newdirs `find $d -type l -exec test -d '{}' \; -print`"
done done
dirs="$newdirs" dirs="$newdirs"
prevdirs="$newdirs"
done done
dirs= dirs=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment