aboutsummaryrefslogtreecommitdiff
path: root/src/tools/pgindent/pgperltidy
blob: 6098e18428ed19af0ab2dfb012b14b2710919bf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# src/tools/pgindent/pgperltidy

set -e

# set this to override default perltidy program:
PERLTIDY=${PERLTIDY:-perltidy}

# locate all Perl files in the tree
(
	# take all .pl and .pm files
	find . -type f -a \( -name '*.pl' -o -name '*.pm' \)
	# take executable files that file(1) thinks are perl files
	find . -type f -perm -100 -exec file {} \; |
	egrep -i ':.*perl[0-9]*\>' |
	cut -d: -f1
) |
sort -u |
xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc

# perltidyrc specifies --backup-and-modify-in-place, so get rid of .bak files
find . -type f -name '*.bak' | xargs rm