diff options
author | Bruce Momjian | 2006-07-11 20:51:25 +0000 |
---|---|---|
committer | Bruce Momjian | 2006-07-11 20:51:25 +0000 |
commit | 215d121f28d11cc04e4fa6da1755c6febb1a791c (patch) | |
tree | 4d29a3e5a7c2f5a83a49039314eb9ecf1e467524 | |
parent | e5adf528b17909f0fbe6c8492e9dda6186b6172e (diff) |
Improve pginclude tests.
-rwxr-xr-x | src/tools/pginclude/pgrminclude | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/tools/pginclude/pgrminclude b/src/tools/pginclude/pgrminclude index ccffe79ad9..97ab5a3646 100755 --- a/src/tools/pginclude/pgrminclude +++ b/src/tools/pginclude/pgrminclude @@ -35,9 +35,9 @@ do # preserve configure-specific includes # these includes are surrounded by #ifdef's grep -B1 '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" | - egrep -q '^#if|^#else' && continue + egrep -q '^#if|^#else' && continue grep -A1 '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" | - egrep -q '^#else|^#endif' && continue + egrep -q '^#else|^#endif' && continue # set up initial file contents cat /tmp/$$a | @@ -61,12 +61,16 @@ do -o /tmp/$$.o >/tmp/$$ 2>&1 if [ "$?" -eq 0 ] then echo "$FILE $INCLUDE" + if [ "$1" = "-v" ] + then cat /tmp/$$ + cat /tmp/$$b + cat /tmp/$$.c + fi grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" >/tmp/$$b mv /tmp/$$b "$FILE" + elif [ "$1" = "-v" ] + then echo "$FILE" fi - if [ "$1" = "-v" ] - then cat /tmp/$$ - cat /tmp/$$.c - fi + done done |