Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit353eb3d

Browse files
committed
Add updates.
1 parent3c4447f commit353eb3d

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

‎src/tools/pginclude/pginclude

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ do
55
sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a
66
echo "#include \"postgres.h\"" >/tmp/$$.c
77
echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
8-
echo "voidmain() {" >>/tmp/$$.c
8+
echo "voidinclude_test() {" >>/tmp/$$.c
99
pgdefine "$FILE" >>/tmp/$$.c
1010
echo "}" >>/tmp/$$.c
1111
cc -Werror -Wall -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1

‎src/tools/pginclude/pgnoinclude

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
:
22
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
3-
find . \( -name CVS -a -prune \) -o -type f -print | while read FILE
3+
find . \( -name CVS -a -prune \) -o -type f -print | grep -v postgres.h |
4+
while read FILE
45
do
5-
cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
6+
if [ "`echo $FILE | sed -n 's/^.*\.\([^\.]*\)$/\1/p'`" = "h" ]
7+
thenIS_INCLUDE="Y"
8+
elseIS_INCLUDE="N"
9+
fi
10+
11+
if [ "$IS_INCLUDE" = "Y" ]
12+
thencat "$FILE" | grep -v "^#if" | grep -v "^#else" |
613
grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a
14+
elsecat "$FILE" >/tmp/$$a
15+
fi
716
cat /tmp/$$a | grep "^#include" |
817
sed 's/#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
918
while read INCLUDE
1019
do
1120
[ -s /usr/include/$INCLUDE ] && continue
1221
cat /tmp/$$a |
1322
grep -v '^#include[ ]*[<"]'"$INCLUDE"'[>"]' >/tmp/$$b
14-
echo "#include \"postgres.h\"" >/tmp/$$.c
23+
if [ "$IS_INCLUDE" = "Y" ]
24+
thenecho "#include \"postgres.h\"" >/tmp/$$.c
25+
else>/tmp/$$.c
26+
fi
1527
echo "#include \"/tmp/$$b\"" >>/tmp/$$.c
16-
echo "void main() {" >>/tmp/$$.c
17-
pgdefine "$FILE" >>/tmp/$$.c
28+
echo "void include_test() {" >>/tmp/$$.c
29+
if [ "$IS_INCLUDE" = "Y" ]
30+
thenpgdefine "$FILE" >>/tmp/$$.c
31+
fi
1832
echo "}" >>/tmp/$$.c
1933
cc -Werror -Wall -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
2034
if [ "$?" -eq 0 ]
2135
thenecho "$FILE $INCLUDE"
36+
if [ "$IS_INCLUDE" = "N" ]
37+
thengrep -v '#include[ ]*[<"]$FILE[>"]' >/tmp/$$a
38+
mv /tmp/$$a "$FILE"
39+
fi
2240
if [ "$1" = "-v" ]
2341
thencat /tmp/$$
2442
cat /tmp/$$.c

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp