Browse Source

Fix shellcheck issues

4.10
Darko Poljak 4 years ago
parent
commit
671bb82a46
  1. 5
      Makefile
  2. 1
      cdist/conf/type/__ssh_authorized_keys/manifest
  3. 16
      scripts/debug-dump.sh

5
Makefile

@ -274,11 +274,14 @@ shellcheck-local-gencodes:
shellcheck-remote-gencodes:
@find cdist/conf/type -type f -name gencode-remote -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0
shellcheck-scripts:
@$(SHELLCHECKCMD) scripts/debug-dump.sh || exit 0
shellcheck-gencodes: shellcheck-local-gencodes shellcheck-remote-gencodes
shellcheck-types: shellcheck-type-explorers shellcheck-manifests shellcheck-gencodes
shellcheck: shellcheck-global-explorers shellcheck-types
shellcheck: shellcheck-global-explorers shellcheck-types shellcheck-scripts
shellcheck-type-files:
@find cdist/conf/type -type f -path "*/files/*" -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0

1
cdist/conf/type/__ssh_authorized_keys/manifest vendored

@ -69,6 +69,7 @@ while read -r key; do
set -- "$@" --key "$key"
set -- "$@" --state "$state"
if [ -f "$__object/parameter/option" ]; then
# shellcheck disable=SC2046
set -- "$@" $(printf -- '--option %s ' $(cat "$__object/parameter/option"))
fi
if [ -f "$__object/parameter/comment" ]; then

16
scripts/debug-dump.sh

@ -204,7 +204,7 @@ or=
print_verbose()
{
if [ ${verbose} -ge $1 ]
if [ "${verbose}" -ge "$1" ]
then
printf "%s\n" "$2"
fi
@ -214,7 +214,7 @@ hor_line()
{
if [ $# -gt 0 ]
then
c=$1
c="$1"
else
c='='
fi
@ -289,7 +289,7 @@ set -- '.' "$@" -exec awk -v prefix="${filename_prefix}" "{print prefix ${ln} \$
print_verbose 2 "Using cache dir: ${cache_dir}"
OLD_PWD=$(pwd)
cd "${cache_dir}"
cd "${cache_dir}" || exit
# If no host is specified then search all.
[ -z "${hosts}" ] && hosts="-"
@ -310,16 +310,16 @@ do
do
dir=$(dirname "${d}")
print_verbose 0 "target host: $(cat ${dir}/target_host), host directory: ${dir}"
hor_line
print_verbose 0 "target host: $(cat "${dir}/target_host"), host directory: ${dir}"
hor_line '='
PREV_PWD=$(pwd)
cd "${dir}"
cd "${dir}" || exit
# set -x
find "$@"
# set +x
cd "${PREV_PWD}"
cd "${PREV_PWD}" || exit
done
IFS="${OLD_IFS}"
done
cd "${OLD_PWD}"
cd "${OLD_PWD}" || exit

Loading…
Cancel
Save