diff --git a/src/tools/pgindent/README b/src/tools/pgindent/README index 8fbf59f5ec..44050c01b3 100644 --- a/src/tools/pgindent/README +++ b/src/tools/pgindent/README @@ -10,7 +10,7 @@ This can format all PostgreSQL *.c and *.h files, but excludes *.y, and 2) Download the typedef file from the buildfarm: - wget -O src/tools/pgindent/typedefs.list http://www.pgbuildfarm.org/cgi-bin/typedefs.pl + wget -O src/tools/pgindent/typedefs.list http://buildfarm.postgresql.org/cgi-bin/typedefs.pl 3) Remove all derived files (pgindent has trouble with one of the flex macros): diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index 429dc7c64b..1a76feacdd 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -21,6 +21,8 @@ fi TYPEDEFS="$1" shift +INDENT=`which indent` + trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15 entab /dev/null if [ "$?" -ne 0 ] @@ -29,12 +31,12 @@ then echo "Go to the src/tools/entab directory and do a 'make' and 'make install echo "Then run $0 again." exit 1 fi -indent -? /dev/null 2>&1 +$INDENT -? /dev/null 2>&1 if [ "$?" -ne 1 ] then echo "You do not appear to have 'indent' installed on your system." >&2 exit 1 fi -indent -gnu /dev/null 2>&1 +$INDENT -gnu /dev/null 2>&1 if [ "$?" -eq 0 ] then echo "You appear to have GNU indent rather than BSD indent." >&2 echo "See the pgindent/README file for a description of its problems." >&2 @@ -136,7 +138,7 @@ do sed 's;^CATALOG(.*$;/*&*/;' >/tmp/$$a # We get the list of typedef's from /src/tools/find_typedef - indent -bad -bap -bc -bl -d0 -cdb -nce -nfc1 -di12 -i4 -l79 \ + $INDENT -bad -bap -bc -bl -d0 -cdb -nce -nfc1 -di12 -i4 -l79 \ -lp -nip -npro -bbb $EXTRA_OPTS \ `egrep -v '^(FD_SET|date|interval|timestamp|ANY)$' "$TYPEDEFS" | sed -e '/^$/d' -e 's/.*/-T& /'` \ /tmp/$$a >/tmp/$$ 2>&1