aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-07-11 20:51:25 +0000
committerBruce Momjian <bruce@momjian.us>2006-07-11 20:51:25 +0000
commit1be8f80288a26e676b8e3860eee07015021d30ba (patch)
tree1f1782a53ea15d4bca5cfe52bb92e3b2b5a06af5 /src
parent4084681546cb187aeddbcf7ffe2eba48ea301810 (diff)
downloadpostgresql-1be8f80288a26e676b8e3860eee07015021d30ba.tar.gz
postgresql-1be8f80288a26e676b8e3860eee07015021d30ba.zip
Improve pginclude tests.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/pginclude/pgrminclude18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tools/pginclude/pgrminclude b/src/tools/pginclude/pgrminclude
index da90b28a823..07e2cb68376 100755
--- a/src/tools/pginclude/pgrminclude
+++ b/src/tools/pginclude/pgrminclude
@@ -1,7 +1,7 @@
:
# remove extra #include's
-# $PostgreSQL: pgsql/src/tools/pginclude/pgrminclude,v 1.11 2006/07/11 20:12:29 momjian Exp $
+# $PostgreSQL: pgsql/src/tools/pginclude/pgrminclude,v 1.12 2006/07/11 20:51:25 momjian Exp $
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
find . \( -name CVS -a -prune \) -o -type f -name '*.[ch]' -print |
@@ -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