From: Bruce Korb Date: Wed, 27 Dec 2000 15:46:42 +0000 (+0000) Subject: "test" is better at testing for directories than "ls" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46159c151de000016ce85c0f2e8c200f96e71ea0;p=gcc.git "test" is better at testing for directories than "ls" From-SVN: r38499 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f1c1e10163..ae909575f00 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,7 @@ * fixinc/Makefile.in: fix for ancient Bourne shell * fixinc/Makefile.BEOS: obsolete * fixinc/Makefile.DOS: obsolete + * fixinc/fixincl.sh(LINKS): use `test -d' rather than `ls' for testing 2000-12-27 Bernd Schmidt diff --git a/gcc/fixinc/fixincl.sh b/gcc/fixinc/fixincl.sh index 9a44cb8cc68..18b5fb24651 100755 --- a/gcc/fixinc/fixincl.sh +++ b/gcc/fixinc/fixincl.sh @@ -449,11 +449,11 @@ if $LINKS; then all_dirs=`find . -type l -print` for file in $all_dirs do - if ls -lLd $file > /dev/null - then : - else rm -f $file - test $VERBOSE -gt 3 && echo " removed $file" - rmdir `dirname $file` > /dev/null && \ + if test ! -d $file + then + rm -f $file + test $VERBOSE -gt 3 && echo " removed $file" + rmdir `dirname $file` > /dev/null && \ test $VERBOSE -gt 3 && \ echo " removed `dirname $file`" fi