#!/bin/sh set -eu version_bootstrap=20171003 dir_download="$PWD/download" mkdir -p build; cd build dir_install="$PWD/install-bootstrap" # Prepare source mkdir -p "go1.4-bootstrap-$version_bootstrap" tar xf "$dir_download/go1.4-bootstrap-$version_bootstrap.tar.gz" -C "go1.4-bootstrap-$version_bootstrap" --strip-components 1 cd "go1.4-bootstrap-$version_bootstrap" # Build and install (cd src; ./make.bash) rm -rf pkg/obj src/cmd src/internal src/builtin find src -type f \( ! -name "*.go" \) -delete find src -type f \( -name "*_test.go" -o -name "*_test_*.go" \) -delete find src -type d -name "testdata" -exec rm -r {} + find src -type d -empty -delete mkdir -p "$dir_install" cp -at "$dir_install" bin pkg src