diff options
| author | KubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com> | 2022-02-28 20:34:07 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-28 20:34:07 +0800 |
| commit | 5412f9d9463ab40a0c84621d415ed262f4d671a7 (patch) | |
| tree | 85ef61cd9e7c4c5b8e4379088732bc8244b9bf85 /hack | |
| parent | Merge pull request #3625 from zhu733756/buildx (diff) | |
| parent | update edged for k8s 1.22 (diff) | |
| download | kubeedge-5412f9d9463ab40a0c84621d415ed262f4d671a7.tar.gz | |
Merge pull request #3624 from Shelley-BaoYue/bump-1.22
update k8s to 1.22
Diffstat (limited to 'hack')
| -rwxr-xr-x | hack/update-vendor-licenses.sh | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/hack/update-vendor-licenses.sh b/hack/update-vendor-licenses.sh index 2cb9972a3..d9fdf78d0 100755 --- a/hack/update-vendor-licenses.sh +++ b/hack/update-vendor-licenses.sh @@ -31,14 +31,13 @@ # KubeEdge Authors: # - File derived from kubernetes v1.19.0-beta.2 # - Changed KUBE_ROOT value to use absolute path -# - skip license for k8s.io/klog set -o errexit set -o nounset set -o pipefail -KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" export LANG=C @@ -203,26 +202,25 @@ for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" >&2 continue fi - if [[ "${PACKAGE}" = "sigs.k8s.io/structured-merge-diff" ]]; then - # this package doesn't exist, but has v3 subdirectory as a different package - # so it can't be filtered by the previous rule - # temporarily treat this way until find out a better rule - echo "${PACKAGE}, temporarily skipping" >&2 - continue - fi - if [[ "${PACKAGE}" = "github.com/cespare/xxhash" ]]; then - # there are 2 versions v1 and v2 under 2 folders indirectly used - # so it can't be filtered by the previous rule - # temporarily treat this way until find out a better rule - echo "${PACKAGE}, temporarily skipping" >&2 - continue - fi - if [[ "${PACKAGE}" = "k8s.io/klog" ]]; then - # this package doesn't use, but has v2 subdirectory as a different package - # so it can't be filtered by the previous rule - # temporarily treat this way until find out a better rule - echo "${PACKAGE}, temporarily skipping" >&2 - continue + # Skip a directory if 1) it has no files and 2) all the subdirectories contain a go.mod file. + misses_go_mod=false + DEPS_SUBDIR="${DEPS_DIR}/${PACKAGE}" + search_for_mods () { + if [[ -z "$(find "${DEPS_SUBDIR}/" -mindepth 1 -maxdepth 1 -type f)" ]]; then + while read -d "" -r SUBDIR; do + if [[ ! -e "${SUBDIR}/go.mod" ]]; then + DEPS_SUBDIR=${SUBDIR} + search_for_mods + fi + done < <(find "${DEPS_SUBDIR}/" -mindepth 1 -maxdepth 1 -type d -print0) + else + misses_go_mod=true + fi + } + search_for_mods + if [[ $misses_go_mod = false ]]; then + echo "${PACKAGE} has no files, skipping" >&2 + continue fi echo "${PACKAGE}" |
