From fa48189a78ac1c05155629c1521d7464ce6c8e5c Mon Sep 17 00:00:00 2001 From: Michal Fojtik Date: Tue, 11 Sep 2018 19:10:00 +0200 Subject: [PATCH 1/2] hack: copy oc to kubectl --- hack/lib/build/binaries.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/hack/lib/build/binaries.sh b/hack/lib/build/binaries.sh index f93cafcaa642..7a5cbb5eb3f3 100644 --- a/hack/lib/build/binaries.sh +++ b/hack/lib/build/binaries.sh @@ -330,6 +330,18 @@ function os::build::place_bins() { fi done + # Link binaries that we want to link (eg. oc->kubectl) + local suffix="" + if [[ $platform == "windows/amd64" ]]; then + suffix=".exe" + fi + for linkname in "${OC_BINARY_COPY[@]}"; do + local src="${OS_OUTPUT_BINPATH}/${platform}/oc${suffix}" + if [[ -f "${src}" ]]; then + ln -f "$src" "${OS_OUTPUT_BINPATH}/${platform}/${linkname}${suffix}" + fi + done + # If no release archive was requested, we're done. if [[ "${OS_RELEASE_ARCHIVE-}" == "" ]]; then continue @@ -342,14 +354,10 @@ function os::build::place_bins() { done # Create binary copies where specified. - local suffix="" - if [[ $platform == "windows/amd64" ]]; then - suffix=".exe" - fi for linkname in "${OC_BINARY_COPY[@]}"; do local src="${release_binpath}/oc${suffix}" if [[ -f "${src}" ]]; then - ln "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}" + cp -f "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}" fi done From 0851007f06d7abbf6734a7be447f8e26fe4eb155 Mon Sep 17 00:00:00 2001 From: Michal Fojtik Date: Wed, 12 Sep 2018 11:52:52 +0200 Subject: [PATCH 2/2] hack: arrays in bash need to have their own line --- hack/build-cross.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/build-cross.sh b/hack/build-cross.sh index 5694dee946c6..d7ed2bcd8f94 100755 --- a/hack/build-cross.sh +++ b/hack/build-cross.sh @@ -93,10 +93,10 @@ if [[ "${OS_BUILD_RELEASE_ARCHIVES-}" != "n" ]]; then os::build::release_sha else # Place binaries only - OS_BUILD_PLATFORMS=("${platforms[@]+"${platforms[@]}"}") \ - os::build::place_bins "${OS_CROSS_COMPILE_BINARIES[@]}" - OS_BUILD_PLATFORMS=("${image_platforms[@]+"${image_platforms[@]}"}") \ - os::build::place_bins "${OS_IMAGE_COMPILE_BINARIES[@]}" + OS_BUILD_PLATFORMS=("${platforms[@]+"${platforms[@]}"}") + os::build::place_bins "${OS_CROSS_COMPILE_BINARIES[@]}" + OS_BUILD_PLATFORMS=("${image_platforms[@]+"${image_platforms[@]}"}") + os::build::place_bins "${OS_IMAGE_COMPILE_BINARIES[@]}" fi if [[ "${OS_GIT_TREE_STATE:-dirty}" == "clean" ]]; then