diff options
Diffstat (limited to 'go/push_goroot')
-rwxr-xr-x | go/push_goroot | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/go/push_goroot b/go/push_goroot index 41612f72..0d7706e1 100755 --- a/go/push_goroot +++ b/go/push_goroot @@ -11,24 +11,19 @@ set -e -o pipefail # It uses "target_sh" to remotely execute commands on the device. # It uses "target_cp" to transfer files to the device. -goroot="$(target_tmpdir)/go" +goroot="$(target_tmpdir)/goroot" for target in "$@" do - echo -n "pushing to ${target} ... " + echo -n "pushing goroot to ${target} ... " target_sh ${target} "rm -rf ${goroot}" target_sh ${target} "mkdir -p ${goroot}/pkg" - pkgdir="$(go_${target} env GOOS)_$(go_${target} env GOARCH)" - if [[ -d "pkg/${pkgdir}_shared" ]] - then - target_cp "pkg/${pkgdir}_shared" ${target}:${goroot}/pkg - target_sh ${target} "ln -s ${pkgdir}_shared ${goroot}/pkg/${pkgdir}" - else - target_cp "pkg/${pkgdir}" ${target}:${goroot}/pkg - fi + cd "$(go_${target} env GOROOT)" + pkgdir="pkg/$(go_${target} env GOOS)_$(go_${target} env GOARCH)" + target_cp "${pkgdir}" ${target}:${goroot}/pkg target_cp "src" ${target}:${goroot} target_cp "lib" ${target}:${goroot} - target_cp "test" ${target}:${goroot} + [[ -d test ]] && target_cp "test" ${target}:${goroot} echo "done" done |