~ubuntu-branches/ubuntu/gutsy/libpgjava/gutsy

« back to all changes in this revision

Viewing changes to src/tools/pginclude/pgfixinclude

  • 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
:
 
2
# change #include's to <> or ""
 
3
 
 
4
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
 
5
find . \( -name CVS -a -prune \) -o -type f -print |
 
6
while read FILE
 
7
do
 
8
        cat "$FILE" | grep "^#include" |
 
9
        sed 's/^#include[       ]*[<"]\([^>"]*\).*$/\1/g' |
 
10
        while read INCLUDE
 
11
        do
 
12
                if [ -s /usr/include/"$INCLUDE" ]
 
13
                then    cat "$FILE" |
 
14
                        sed 's;^#include[       ][      ]*[<"]'"$INCLUDE"'[>"]$;#include <'"$INCLUDE"'>;g' >/tmp/$$
 
15
                else    cat "$FILE" |
 
16
                        sed 's;^#include[       ][      ]*[<"]'"$INCLUDE"'[>"]$;#include "'"$INCLUDE"'";g' >/tmp/$$
 
17
                fi
 
18
                cat /tmp/$$ > "$FILE"
 
19
        done
 
20
done