Merge pull request #76311 from SataQiu/fix-hack-20190409

Fix shellcheck failures of hack/update-vendor-licenses.sh
This commit is contained in:
Kubernetes Prow Robot 2019-04-10 22:42:21 -07:00 committed by GitHub
commit ef830e2bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -51,7 +51,6 @@
./hack/update-gofmt.sh ./hack/update-gofmt.sh
./hack/update-openapi-spec.sh ./hack/update-openapi-spec.sh
./hack/update-translations.sh ./hack/update-translations.sh
./hack/update-vendor-licenses.sh
./hack/update-vendor.sh ./hack/update-vendor.sh
./hack/verify-api-groups.sh ./hack/verify-api-groups.sh
./hack/verify-boilerplate.sh ./hack/verify-boilerplate.sh

View File

@ -93,7 +93,8 @@ process_content () {
esac esac
# Find files - only root and package level # 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 for dir_root in ${package} ${package_root}; do
[[ -d ${DEPS_DIR}/${dir_root} ]] || continue [[ -d ${DEPS_DIR}/${dir_root} ]] || continue
@ -101,7 +102,7 @@ process_content () {
find "${DEPS_DIR}/${dir_root}" \ find "${DEPS_DIR}/${dir_root}" \
-xdev -follow -maxdepth ${find_maxdepth} \ -xdev -follow -maxdepth ${find_maxdepth} \
-type f "${find_names[@]}" -type f "${find_names[@]}"
done | sort -u)) done | sort -u)"
local index local index
local f local f
@ -126,13 +127,13 @@ process_content () {
############################################################################# #############################################################################
# MAIN # MAIN
############################################################################# #############################################################################
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh" source "${KUBE_ROOT}/hack/lib/init.sh"
export GO111MODULE=on export GO111MODULE=on
# Check bash version # Check bash version
if ((${BASH_VERSINFO[0]}<4)); then if (( BASH_VERSINFO[0] < 4 )); then
echo echo
echo "ERROR: Bash v4+ required." echo "ERROR: Bash v4+ required."
# Extra help for OSX # Extra help for OSX
@ -161,7 +162,7 @@ echo "= Kubernetes licensed under: ="
echo echo
cat "${LICENSE_ROOT}/LICENSE" cat "${LICENSE_ROOT}/LICENSE"
echo echo
echo "= LICENSE $(cat "${LICENSE_ROOT}/LICENSE" | md5sum | awk '{print $1}')" echo "= LICENSE $(md5sum < "${LICENSE_ROOT}/LICENSE" | awk '{print $1}')"
echo "================================================================================" echo "================================================================================"
) > ${TMP_LICENSE_FILE} ) > ${TMP_LICENSE_FILE}
@ -210,7 +211,7 @@ __EOF__
cat "${file}" cat "${file}"
echo echo
echo "= ${file} $(cat "${file}" | md5sum | awk '{print $1}')" echo "= ${file} $(md5sum < "${file}" | awk '{print $1}')"
echo "================================================================================" echo "================================================================================"
echo echo
done >> ${TMP_LICENSE_FILE} done >> ${TMP_LICENSE_FILE}