diff options
author | Bruce Korb <autogen@linuxbox.com> | 1999-01-27 09:06:42 +0000 |
---|---|---|
committer | Bruce Korb <autogen@linuxbox.com> | 1999-01-27 09:06:42 +0000 |
commit | 5505dbd04b6698b6fdddd2be28246e2259899fe5 (patch) | |
tree | e2f702f999979600af1225efea4af21ed8ec1a13 | |
parent | 598c7b0ba28cecf2c0589714b83930287a225b60 (diff) |
Added a protection around a '[ -r xx ]' test.fixincl-branch
This fails with a file-not-found error on some systems??
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/fixincl-branch@24885 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rwxr-xr-x | gcc/fixinc/fixincl.sh | 26 | ||||
-rwxr-xr-x | gcc/fixinc/inclhack.sh | 26 | ||||
-rw-r--r-- | gcc/fixinc/inclhack.tpl | 24 |
4 files changed, 44 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43fb6bc008b..14a9ac286be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -5,6 +5,9 @@ * fixinc/server.c: Removed the process open code * fixinc/procopen.c: New file containing the proc open code + * fixinc/inclhack.tpl: Added code to bypass a readability test + when a file is not present. A problem on some systems. + * fixinc/inclhack.sh, fixinc/fixincl.sh: regenerated 1999-01-15 Manfred Hollstein <manfred@s-direktnet.de> diff --git a/gcc/fixinc/fixincl.sh b/gcc/fixinc/fixincl.sh index c28e5c7ff26..1c9ab1413a2 100755 --- a/gcc/fixinc/fixincl.sh +++ b/gcc/fixinc/fixincl.sh @@ -2,7 +2,7 @@ # # DO NOT EDIT THIS FILE (fixincl.sh) # -# It has been autogen-ed Tuesday January 5, 1999 at 09:22:32 AM PST +# It has been autogen-ed Wednesday January 27, 1999 at 09:03:56 AM PST # From the definitions inclhack.def # and the template file inclhack.tpl # @@ -341,18 +341,20 @@ while [ $# != 0 ]; do # cd ${INPUT} cd $1 - if [ -r $2 ] && [ ! -r $3 ]; then - cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2 - chmod +w $3 2>/dev/null - chmod a+r $3 2>/dev/null - echo Copied $2 - for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | + if [ -f $2 ] ; then + if [ -r $2 ] && [ ! -r $3 ]; then + cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2 + chmod +w $3 2>/dev/null + chmod a+r $3 2>/dev/null + echo Copied $2 + for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` - do - dir=`echo $2 | sed -e s'|/[^/]*$||'` - dir2=`echo $3 | sed -e s'|/[^/]*$||'` - newreq="$newreq $1 $dir/$include $dir2/$include" - done + do + dir=`echo $2 | sed -e s'|/[^/]*$||'` + dir2=`echo $3 | sed -e s'|/[^/]*$||'` + newreq="$newreq $1 $dir/$include $dir2/$include" + done + fi fi shift; shift; shift done diff --git a/gcc/fixinc/inclhack.sh b/gcc/fixinc/inclhack.sh index 8622deb4527..f56e9a5f784 100755 --- a/gcc/fixinc/inclhack.sh +++ b/gcc/fixinc/inclhack.sh @@ -2,7 +2,7 @@ # # DO NOT EDIT THIS FILE (inclhack.sh) # -# It has been autogen-ed Tuesday January 5, 1999 at 09:21:13 AM PST +# It has been autogen-ed Wednesday January 27, 1999 at 09:03:36 AM PST # From the definitions inclhack.def # and the template file inclhack.tpl # @@ -3061,18 +3061,20 @@ while [ $# != 0 ]; do # cd ${INPUT} cd $1 - if [ -r $2 ] && [ ! -r $3 ]; then - cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2 - chmod +w $3 2>/dev/null - chmod a+r $3 2>/dev/null - echo Copied $2 - for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | + if [ -f $2 ] ; then + if [ -r $2 ] && [ ! -r $3 ]; then + cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2 + chmod +w $3 2>/dev/null + chmod a+r $3 2>/dev/null + echo Copied $2 + for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` - do - dir=`echo $2 | sed -e s'|/[^/]*$||'` - dir2=`echo $3 | sed -e s'|/[^/]*$||'` - newreq="$newreq $1 $dir/$include $dir2/$include" - done + do + dir=`echo $2 | sed -e s'|/[^/]*$||'` + dir2=`echo $3 | sed -e s'|/[^/]*$||'` + newreq="$newreq $1 $dir/$include $dir2/$include" + done + fi fi shift; shift; shift done diff --git a/gcc/fixinc/inclhack.tpl b/gcc/fixinc/inclhack.tpl index 537b1e188c5..06b49aeabe9 100644 --- a/gcc/fixinc/inclhack.tpl +++ b/gcc/fixinc/inclhack.tpl @@ -338,18 +338,20 @@ while [ $# != 0 ]; do # cd ${INPUT} cd $1 - if [ -r $2 ] && [ ! -r $3 ]; then - cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2 - chmod +w $3 2>/dev/null - chmod a+r $3 2>/dev/null - echo Copied $2 - for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | + if [ -f $2 ] ; then + if [ -r $2 ] && [ ! -r $3 ]; then + cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2 + chmod +w $3 2>/dev/null + chmod a+r $3 2>/dev/null + echo Copied $2 + for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` - do - dir=`echo $2 | sed -e s'|/[^/]*$||'` - dir2=`echo $3 | sed -e s'|/[^/]*$||'` - newreq="$newreq $1 $dir/$include $dir2/$include" - done + do + dir=`echo $2 | sed -e s'|/[^/]*$||'` + dir2=`echo $3 | sed -e s'|/[^/]*$||'` + newreq="$newreq $1 $dir/$include $dir2/$include" + done + fi fi shift; shift; shift done |