summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2011-02-17 19:37:47 +0000
committerAlvaro Herrera2011-02-18 01:20:19 +0000
commitc4d124365b9b535e8c98e4568ade3e0c15b11810 (patch)
treeabe4abb8b0bdd3019401e16619e726c266d09984
parent52b60530f257b1591d8b72264cd6c0dd9aabfd46 (diff)
Use $INDENT rather than indent throughout the pgindent code
This allows the user to change the path to be used more easily. Also, change URL in README.
-rw-r--r--src/tools/pgindent/README2
-rwxr-xr-xsrc/tools/pgindent/pgindent8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/tools/pgindent/README b/src/tools/pgindent/README
index 8fbf59f5ec8..44050c01b34 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 429dc7c64b1..1a76feacdd6 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 >/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 >/dev/null 2>&1
+$INDENT -? </dev/null >/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 >/dev/null 2>&1
+$INDENT -gnu </dev/null >/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