From e426dd78a14eb72ac6a5b68b6d12b2923ddd11f4 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Fri, 5 Sep 2014 13:38:05 -0400 Subject: [PATCH] function to turn list of targets to list of go packages --- hack/build-go.sh | 5 +---- hack/config-go.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hack/build-go.sh b/hack/build-go.sh index a011ed852bf..d3800fc4a26 100755 --- a/hack/build-go.sh +++ b/hack/build-go.sh @@ -51,10 +51,7 @@ if [[ ${#targets[@]} -eq 0 ]]; then targets=($(kube::default_build_targets)) fi -binaries=() -for target in ${targets[@]}; do - binaries+=("${KUBE_GO_PACKAGE}/${target}") -done +binaries=($(kube::binaries_from_targets "${targets[@]}")) echo "Building local go components" # Note that the flags to 'go build' are duplicated in the salt build setup diff --git a/hack/config-go.sh b/hack/config-go.sh index 9d92b53e90f..d49b8a0688e 100644 --- a/hack/config-go.sh +++ b/hack/config-go.sh @@ -123,6 +123,15 @@ kube::default_build_targets() { echo "cmd/kubecfg" echo "plugin/cmd/scheduler" } + +# kube::binaries_from_targets take a list of build targets and return the +# full go package to be built +kube::binaries_from_targets() { + local target + for target; do + echo "${KUBE_GO_PACKAGE}/${target}" + done +} # --- Environment Variables --- # KUBE_REPO_ROOT - Path to the top of the build tree.