~ubuntu-branches/ubuntu/wily/libpgjava/wily

« back to all changes in this revision

Viewing changes to src/tools/pgindent/pgcppindent

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2005-04-21 14:25:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050421142511-wibh5vc31fkrorx7
Tags: 7.4.7-3
Built with sources...

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=ansi -b -p -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