~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/tools/pgindent/pgjindent

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15
 
4
entab </dev/null >/dev/null
 
5
if [ "$?" -ne 0 ]
 
6
then    echo "Go to the src/tools/entab directory and do a 'make' and 'make install'." >&2
 
7
        echo "This will put the 'entab' command in your path." >&2
 
8
        echo "Then run $0 again."
 
9
        exit 1
 
10
fi
 
11
astyle --version </dev/null >/dev/null 2>&1
 
12
if [ "$?" -eq 0 ]
 
13
then    echo "You do not appear to have 'astyle' installed on your system." >&2
 
14
        exit 1
 
15
fi
 
16
 
 
17
for FILE
 
18
do
 
19
        astyle --style=java -b -p -j -S < "$FILE" >/tmp/$$ 2>/tmp/$$a
 
20
        if [ "$?" -ne 0 -o -s /tmp/$$a ]
 
21
        then    echo "$FILE"
 
22
                cat /tmp/$$a
 
23
        fi
 
24
        cat /tmp/$$ |
 
25
        entab -t4 -qc |
 
26
        cat >/tmp/$$a && cat /tmp/$$a >"$FILE"
 
27
done