mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 06:43:54 +00:00
Write a parallel (godeps) _workspace tree to hold all the missing files.
godeps doesn't get everything we want, so fix the problem but write it to a parallel tree since _workspace is reserved only for godeps auto-generated files.
This commit is contained in:
parent
2c5ece3534
commit
3e613ee341
@ -73,6 +73,7 @@ process_content () {
|
|||||||
local ensure_pattern
|
local ensure_pattern
|
||||||
local package_root_url
|
local package_root_url
|
||||||
local dir_root
|
local dir_root
|
||||||
|
local godeps_root
|
||||||
local find_maxdepth
|
local find_maxdepth
|
||||||
local find_names
|
local find_names
|
||||||
local -a local_files=()
|
local -a local_files=()
|
||||||
@ -111,9 +112,14 @@ process_content () {
|
|||||||
|
|
||||||
# Find LOCAL files first - only root and package level
|
# Find LOCAL files first - only root and package level
|
||||||
for dir_root in ${package} ${package_root}; do
|
for dir_root in ${package} ${package_root}; do
|
||||||
|
for godeps_root in ${GODEPS_SRC} ${GODEPS_AUX}; do
|
||||||
|
[[ -d ${godeps_root}/${dir_root} ]] || continue
|
||||||
|
|
||||||
# One (set) of these is fine
|
# One (set) of these is fine
|
||||||
local_files+=($(find ${GODEPS_SRC}/${dir_root} -xdev -follow \
|
local_files+=($(find ${godeps_root}/${dir_root} \
|
||||||
-maxdepth ${find_maxdepth} -type f "${find_names[@]}"))
|
-xdev -follow -maxdepth ${find_maxdepth} \
|
||||||
|
-type f "${find_names[@]}"))
|
||||||
|
done
|
||||||
done
|
done
|
||||||
# Uniquely sort the array
|
# Uniquely sort the array
|
||||||
IFS=$'\n' local_files=($(LC_ALL=C sort -u <<<"${local_files[*]-}"))
|
IFS=$'\n' local_files=($(LC_ALL=C sort -u <<<"${local_files[*]-}"))
|
||||||
@ -143,9 +149,9 @@ process_content () {
|
|||||||
|
|
||||||
if [[ -n "${FILE_CONTENT[${package}-${type}]-}" ]]; then
|
if [[ -n "${FILE_CONTENT[${package}-${type}]-}" ]]; then
|
||||||
if ((CREATE_MISSING)); then
|
if ((CREATE_MISSING)); then
|
||||||
mkdir -p ${GODEPS_SRC}/${package_root}
|
mkdir -p ${GODEPS_AUX}/${package_root}
|
||||||
echo "${FILE_CONTENT[${package}-${type}]}" \
|
echo "${FILE_CONTENT[${package}-${type}]}" \
|
||||||
> ${GODEPS_SRC}/${package_root}/${f}
|
> ${GODEPS_AUX}/${package_root}/${f}
|
||||||
fi
|
fi
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -172,6 +178,7 @@ GODEPS_STATE="Godeps/.license_file_state"
|
|||||||
|
|
||||||
GODEPS_LICENSE_FILE=${1:-"Godeps/LICENSES"}
|
GODEPS_LICENSE_FILE=${1:-"Godeps/LICENSES"}
|
||||||
GODEPS_SRC="Godeps/_workspace/src"
|
GODEPS_SRC="Godeps/_workspace/src"
|
||||||
|
GODEPS_AUX="Godeps/_workspace_aux/src"
|
||||||
declare -Ag FILE_CONTENT
|
declare -Ag FILE_CONTENT
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ KUBE_ROOT="${_tmpdir}" "${KUBE_ROOT}/hack/update-godep-licenses.sh"
|
|||||||
|
|
||||||
# Compare Godep Licenses
|
# Compare Godep Licenses
|
||||||
if ! _out="$(diff -Naupr ${KUBE_ROOT}/Godeps/LICENSES ${_tmpdir}/Godeps/LICENSES)"; then
|
if ! _out="$(diff -Naupr ${KUBE_ROOT}/Godeps/LICENSES ${_tmpdir}/Godeps/LICENSES)"; then
|
||||||
echo "Your godep licenses file is out of date. Run hack/update-godep-licenses.sh and commit the results."
|
echo "Your godep licenses file is out of date. Run hack/update-godep-licenses.sh --create-missing and commit the results."
|
||||||
echo "${_out}"
|
echo "${_out}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user