From d9a9ab193a00123d5839505ddfe1563c2286bb9f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 24 Feb 2018 19:48:14 +0100 Subject: bin/strict-bashism-check: check lib/, too --- bin/strict-bashism-check | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/strict-bashism-check') diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check index 3bb3884..b1bd3bf 100755 --- a/bin/strict-bashism-check +++ b/bin/strict-bashism-check @@ -52,7 +52,7 @@ git archive "${tree}" | \ errors=$( cd "${tmp_dir}" || \ echo 'Cannot cd.' - find "bin" "conf" -type f -not -executable -not -name '.gitignore' + find bin conf lib -type f -not -executable -not -name '.gitignore' ) if [ -n "${errors}" ]; then @@ -63,7 +63,7 @@ fi errors=$( # shellcheck disable=SC2016 - find bin conf -type f -executable -exec grep -H '="\$(' {} \; + find bin conf lib -type f -executable -exec grep -H '="\$(' {} \; ) if [ -n "${errors}" ]; then -- cgit v1.2.3-54-g00ecf From 98c468dee44e09a27c89019c3d8c584efe0bf1c0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 7 Mar 2018 16:29:58 +0100 Subject: bin/strict-bashism-check: do not fail if shellcheck is not available --- bin/strict-bashism-check | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'bin/strict-bashism-check') diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check index b1bd3bf..fa073b8 100755 --- a/bin/strict-bashism-check +++ b/bin/strict-bashism-check @@ -72,14 +72,16 @@ if [ -n "${errors}" ]; then exit 1 fi -errors=$( - cd "${tmp_dir}" || \ - echo 'Cannot cd.' - shellcheck -x bin/* conf/* 2>&1 -) - -if [ -n "${errors}" ]; then - >&2 echo 'shellcheck complains about the following:' - >&2 echo "${errors}" - exit 1 +if which shellcheck >/dev/null 2>&1; then + errors=$( + cd "${tmp_dir}" || \ + echo 'Cannot cd.' + shellcheck -x bin/* conf/* 2>&1 + ) + + if [ -n "${errors}" ]; then + >&2 echo 'shellcheck complains about the following:' + >&2 echo "${errors}" + exit 1 + fi fi -- cgit v1.2.3-54-g00ecf From 254ba8ac7e63d024da55f459a9d9d76c65e8d3ce Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 14 Mar 2018 10:52:58 +0100 Subject: bin/strict-bashism-check: add some check for "mysql buildmaster" --- bin/strict-bashism-check | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'bin/strict-bashism-check') diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check index fa073b8..1d7c2be 100755 --- a/bin/strict-bashism-check +++ b/bin/strict-bashism-check @@ -49,14 +49,27 @@ trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT git archive "${tree}" | \ tar -C "${tmp_dir}" -x +if ! cd "${tmp_dir}"; then + echo 'Cannot cd.' + exit 1 +fi + errors=$( - cd "${tmp_dir}" || \ - echo 'Cannot cd.' find bin conf lib -type f -not -executable -not -name '.gitignore' ) if [ -n "${errors}" ]; then - >&2 echo 'Non-executable files found in bin/ or conf/:' + >&2 echo 'Non-executable files found in bin/, conf/ or lib/:' + >&2 echo "${errors}" + exit 1 +fi + +errors=$( + grep -r '\(\s\|^\)mysql buildmaster\($\|\s\)' bin lib conf +) + +if [ -n "${errors}" ]; then + >&2 echo 'Style error: call "mysql_run_query" instead of "mysql buildmaster":' >&2 echo "${errors}" exit 1 fi @@ -74,8 +87,6 @@ fi if which shellcheck >/dev/null 2>&1; then errors=$( - cd "${tmp_dir}" || \ - echo 'Cannot cd.' shellcheck -x bin/* conf/* 2>&1 ) -- cgit v1.2.3-54-g00ecf From 09fee973260d9d2c944e6538d46be157aae74236 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 14 Mar 2018 15:47:35 +0100 Subject: bin/strict-bashism-check: check lib/, too - except opcode_list --- bin/strict-bashism-check | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin/strict-bashism-check') diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check index 1d7c2be..cbf7e5b 100755 --- a/bin/strict-bashism-check +++ b/bin/strict-bashism-check @@ -87,7 +87,11 @@ fi if which shellcheck >/dev/null 2>&1; then errors=$( - shellcheck -x bin/* conf/* 2>&1 + find bin conf lib \ + -type f \ + -not -name 'opcode_list' \ + -not -name '.*' \ + -exec shellcheck -x '{}' \; 2>&1 ) if [ -n "${errors}" ]; then -- cgit v1.2.3-54-g00ecf