diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index 3fbdac45e68..842679db1d1 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -51,7 +51,6 @@ ./hack/update-gofmt.sh ./hack/update-openapi-spec.sh ./hack/update-translations.sh -./hack/update-vendor-licenses.sh ./hack/update-vendor.sh ./hack/verify-api-groups.sh ./hack/verify-boilerplate.sh diff --git a/hack/update-vendor-licenses.sh b/hack/update-vendor-licenses.sh index b823cb8125f..21d7d2f42cf 100755 --- a/hack/update-vendor-licenses.sh +++ b/hack/update-vendor-licenses.sh @@ -93,7 +93,8 @@ process_content () { esac # Find files - only root and package level - local_files=($( + local_files=() + IFS=" " read -r -a local_files <<< "$( for dir_root in ${package} ${package_root}; do [[ -d ${DEPS_DIR}/${dir_root} ]] || continue @@ -101,7 +102,7 @@ process_content () { find "${DEPS_DIR}/${dir_root}" \ -xdev -follow -maxdepth ${find_maxdepth} \ -type f "${find_names[@]}" - done | sort -u)) + done | sort -u)" local index local f @@ -126,13 +127,13 @@ process_content () { ############################################################################# # MAIN ############################################################################# -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" export GO111MODULE=on # Check bash version -if ((${BASH_VERSINFO[0]}<4)); then +if (( BASH_VERSINFO[0] < 4 )); then echo echo "ERROR: Bash v4+ required." # Extra help for OSX @@ -161,7 +162,7 @@ echo "= Kubernetes licensed under: =" echo cat "${LICENSE_ROOT}/LICENSE" echo -echo "= LICENSE $(cat "${LICENSE_ROOT}/LICENSE" | md5sum | awk '{print $1}')" +echo "= LICENSE $(md5sum < "${LICENSE_ROOT}/LICENSE" | awk '{print $1}')" echo "================================================================================" ) > ${TMP_LICENSE_FILE} @@ -210,7 +211,7 @@ __EOF__ cat "${file}" echo - echo "= ${file} $(cat "${file}" | md5sum | awk '{print $1}')" + echo "= ${file} $(md5sum < "${file}" | awk '{print $1}')" echo "================================================================================" echo done >> ${TMP_LICENSE_FILE}