1999-07-15 22:32:30 +02:00
|
|
|
:
|
2000-06-15 00:28:16 +02:00
|
|
|
# change #include's to <> or ""
|
2006-03-11 05:38:42 +01:00
|
|
|
# $PostgreSQL: pgsql/src/tools/pginclude/pgfixinclude,v 1.5 2006/03/11 04:38:42 momjian Exp $
|
2000-05-29 19:40:45 +02:00
|
|
|
|
1999-07-15 22:32:30 +02:00
|
|
|
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 -print |
|
|
|
|
while read FILE
|
|
|
|
do
|
1999-07-16 00:40:16 +02:00
|
|
|
cat "$FILE" | grep "^#include" |
|
1999-07-15 22:32:30 +02:00
|
|
|
sed 's/^#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
|
|
|
|
while read INCLUDE
|
|
|
|
do
|
|
|
|
if [ -s /usr/include/"$INCLUDE" ]
|
|
|
|
then cat "$FILE" |
|
1999-07-16 00:40:16 +02:00
|
|
|
sed 's;^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]$;#include <'"$INCLUDE"'>;g' >/tmp/$$
|
1999-07-15 22:32:30 +02:00
|
|
|
else cat "$FILE" |
|
1999-07-16 00:40:16 +02:00
|
|
|
sed 's;^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]$;#include "'"$INCLUDE"'";g' >/tmp/$$
|
1999-07-15 22:32:30 +02:00
|
|
|
fi
|
|
|
|
cat /tmp/$$ > "$FILE"
|
|
|
|
done
|
|
|
|
done
|