mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Fix update/verify-codecgen.sh for OSX.
This commit is contained in:
parent
bf67eab89f
commit
32f5f4f239
@ -40,3 +40,16 @@ source "${KUBE_ROOT}/hack/lib/golang.sh"
|
|||||||
source "${KUBE_ROOT}/hack/lib/etcd.sh"
|
source "${KUBE_ROOT}/hack/lib/etcd.sh"
|
||||||
|
|
||||||
KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::util::host_platform)"
|
KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::util::host_platform)"
|
||||||
|
|
||||||
|
# emulates "readlink -f" which is not available on BSD (OS X).
|
||||||
|
function readlinkdashf {
|
||||||
|
path=$1
|
||||||
|
# Follow links until there are no more links to follow.
|
||||||
|
while readlink "$path"; do
|
||||||
|
path="$(readlink $path)"
|
||||||
|
done
|
||||||
|
# Convert to canonical path.
|
||||||
|
path=$(cd "$(dirname "${path}")" && pwd -P)
|
||||||
|
echo "$path"
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -53,8 +53,7 @@ result=""
|
|||||||
function depends {
|
function depends {
|
||||||
file=${generated_files[$1]//\.generated\.go/.go}
|
file=${generated_files[$1]//\.generated\.go/.go}
|
||||||
deps=$(go list -f "{{.Deps}}" ${file} | tr "[" " " | tr "]" " ")
|
deps=$(go list -f "{{.Deps}}" ${file} | tr "[" " " | tr "]" " ")
|
||||||
inputfile=${generated_files[$2]//\.generated\.go/.go}
|
fullpath=$(readlinkdashf "${generated_files[$2]//\.generated\.go/.go}")
|
||||||
fullpath=${generated_files[$2]//\.generated\.go/.go}
|
|
||||||
candidate=$(dirname "${fullpath}")
|
candidate=$(dirname "${fullpath}")
|
||||||
result=false
|
result=false
|
||||||
for dep in ${deps}; do
|
for dep in ${deps}; do
|
||||||
@ -103,7 +102,6 @@ for (( i=0; i < number; i++ )); do
|
|||||||
rm -f "${generated_files[${i}]}"
|
rm -f "${generated_files[${i}]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Generate files in the dependency order.
|
# Generate files in the dependency order.
|
||||||
for current in "${index[@]}"; do
|
for current in "${index[@]}"; do
|
||||||
generated_file=${generated_files[${current}]}
|
generated_file=${generated_files[${current}]}
|
||||||
|
@ -54,7 +54,7 @@ result=""
|
|||||||
function depends {
|
function depends {
|
||||||
file=${generated_files[$1]//\.generated\.go/.go}
|
file=${generated_files[$1]//\.generated\.go/.go}
|
||||||
deps=$(go list -f "{{.Deps}}" ${file} | tr "[" " " | tr "]" " ")
|
deps=$(go list -f "{{.Deps}}" ${file} | tr "[" " " | tr "]" " ")
|
||||||
fullpath=$(readlink -f ${generated_files[$2]//\.generated\.go/.go})
|
fullpath=$(readlinkdashf "${generated_files[$2]//\.generated\.go/.go}")
|
||||||
candidate=$(dirname "${fullpath}")
|
candidate=$(dirname "${fullpath}")
|
||||||
result=false
|
result=false
|
||||||
for dep in ${deps}; do
|
for dep in ${deps}; do
|
||||||
|
Loading…
Reference in New Issue
Block a user