aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/perlcheck/find_perl_files8
-rwxr-xr-xsrc/tools/perlcheck/pgperlcritic2
-rwxr-xr-xsrc/tools/perlcheck/pgperlsyncheck2
-rw-r--r--src/tools/pgindent/README2
-rwxr-xr-xsrc/tools/pgindent/pgperltidy2
5 files changed, 10 insertions, 6 deletions
diff --git a/src/tools/perlcheck/find_perl_files b/src/tools/perlcheck/find_perl_files
index fd99dab83b0..20dceb800d0 100644
--- a/src/tools/perlcheck/find_perl_files
+++ b/src/tools/perlcheck/find_perl_files
@@ -3,11 +3,15 @@
# shell function to find all perl files in the source tree
find_perl_files () {
+ if [ $# -eq 0 ]; then
+ echo 'No files to process' 1>&2
+ return
+ fi
{
# take all .pl and .pm files
- find . -type f -name '*.p[lm]' -print
+ find "$@" -type f -name '*.p[lm]' -print
# take executable files that file(1) thinks are perl files
- find . -type f -perm -100 -exec file {} \; -print |
+ find "$@" -type f -perm -100 -exec file {} \; -print |
egrep -i ':.*perl[0-9]*\>' |
cut -d: -f1
} | sort -u | grep -v '^\./\.git/'
diff --git a/src/tools/perlcheck/pgperlcritic b/src/tools/perlcheck/pgperlcritic
index 1c2f787580a..2ec6f20de31 100755
--- a/src/tools/perlcheck/pgperlcritic
+++ b/src/tools/perlcheck/pgperlcritic
@@ -14,7 +14,7 @@ PERLCRITIC=${PERLCRITIC:-perlcritic}
. src/tools/perlcheck/find_perl_files
-find_perl_files | xargs $PERLCRITIC \
+find_perl_files "$@" | xargs $PERLCRITIC \
--quiet \
--program-extensions .pl \
--profile=src/tools/perlcheck/perlcriticrc
diff --git a/src/tools/perlcheck/pgperlsyncheck b/src/tools/perlcheck/pgperlsyncheck
index 730f5927cda..da59c9727c0 100755
--- a/src/tools/perlcheck/pgperlsyncheck
+++ b/src/tools/perlcheck/pgperlsyncheck
@@ -13,4 +13,4 @@ set -e
# for zsh
setopt shwordsplit 2>/dev/null || true
-find_perl_files | xargs -L 1 perl $INCLUDES -cw 2>&1 | grep -v OK
+find_perl_files "$@" | xargs -L 1 perl $INCLUDES -cw 2>&1 | grep -v OK
diff --git a/src/tools/pgindent/README b/src/tools/pgindent/README
index b2b134ee6a2..f5fdfc5d2ff 100644
--- a/src/tools/pgindent/README
+++ b/src/tools/pgindent/README
@@ -45,7 +45,7 @@ DOING THE INDENT RUN:
4) Indent the Perl code using perltidy:
- src/tools/pgindent/pgperltidy
+ src/tools/pgindent/pgperltidy .
If you want to use some perltidy version that's not in your PATH,
first set the PERLTIDY environment variable to point to it.
diff --git a/src/tools/pgindent/pgperltidy b/src/tools/pgindent/pgperltidy
index 5e704119eb7..6af27d21d55 100755
--- a/src/tools/pgindent/pgperltidy
+++ b/src/tools/pgindent/pgperltidy
@@ -9,4 +9,4 @@ PERLTIDY=${PERLTIDY:-perltidy}
. src/tools/perlcheck/find_perl_files
-find_perl_files | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc
+find_perl_files "$@" | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc