pgperltidy requires a particular version of perltidy, but the version
wasn't checked like how pgindent checks the underlying indent binary.
Fix by checking the version of perltidy and error out if an incorrect
version is used.
Author: Daniel Gustafsson <
[email protected]>
Reported-by: Tom Lane <[email protected]>
Reviewed-by: Dagfinn Ilmari Mannsåker <[email protected]>
Reviewed-by: Álvaro Herrera <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Reviewed-by: Andrew Dunstan <[email protected]>
Discussion: https://postgr.es/m/
1209850.
1764092152@sss.pgh.pa.us
# set this to override default perltidy program:
PERLTIDY=${PERLTIDY:-perltidy}
+PERLTIDY_VERSION=20230309
+if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then
+ echo "You do not appear to have $PERLTIDY version $PERLTIDY_VERSION installed on your system." >&2
+ exit 1
+fi
+
. src/tools/perlcheck/find_perl_files
find_perl_files "$@" | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc