--- gcc/fixincludes 2018/04/24 16:46:51 1.1.1.6 +++ gcc/fixincludes 2018/04/24 16:49:34 1.1.1.9 @@ -8,28 +8,35 @@ # Directory in which to store the results. LIB=/usr/local/lib/gcc-include -mkdir $LIB > /dev/null 2>&1 +echo 'Making directories:' +cd /usr/include +files=`find . -type d -print` +for file in $files; do + mkdir $LIB/$file > /dev/null 2>&1 +done echo 'Finding header files:' cd /usr/include -files=`find . -print` +files=`find . -type f -print` echo 'Checking header files:' for file in $files; do if egrep -s '[ ]_IO[A-Z]*\(|#define._IO|CTRL' $file; then echo Fixing $file if [ -r $file ]; then cp $file ${LIB}/$file >/dev/null 2>&1 \ - || (mkdir `dirname ${LIB}/$file` \ - && cp $file ${LIB}/$file) \ || echo "Can't copy $file" chmod +w ${LIB}/$file ex ${LIB}/$file </dev/null 2>&1; then + echo Deleting ${LIB}/$file\; no fixes were needed. + rm ${LIB}/$file + fi fi fi done @@ -40,8 +47,6 @@ file=sundev/vuid_event.h if [ -r $file ]; then if [ ! -r ${LIB}/$file ]; then cp $file ${LIB}/$file >/dev/null 2>&1 \ - || (mkdir `dirname ${LIB}/$file` \ - && cp $file ${LIB}/$file) \ || echo "Can't copy $file" chmod +w ${LIB}/$file fi