Merge pull request #114782 from skitt/vendor-license-submodules

Licensing: skip modules with fewer subdirs than mods
This commit is contained in:
Kubernetes Prow Robot 2023-01-03 10:35:46 -08:00 committed by GitHub
commit 83afc363a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,8 +201,8 @@ for PACKAGE in ${modules}; do
# if there are no files vendored under this package...
if [[ -z "$(find "${DEPS_DIR}/${PACKAGE}" -mindepth 1 -maxdepth 1 -type f)" ]]; then
# and we have the same number of submodules as subdirectories...
if [[ "$(find "${DEPS_DIR}/${PACKAGE}/" -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq "$(echo "${modules}" | grep -cE "^${PACKAGE}/")" ]]; then
# and we have at least the same number of submodules as subdirectories...
if [[ "$(find "${DEPS_DIR}/${PACKAGE}/" -mindepth 1 -maxdepth 1 -type d | wc -l)" -le "$(echo "${modules}" | grep -cE "^${PACKAGE}/")" ]]; then
echo "Only submodules of ${PACKAGE} are vendored, skipping" >&2
continue
fi