echo '##### Building Go bootstrap tool.'
echo cmd/dist
export GOROOT="$(cd .. && pwd)"
-GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+for go_exe in $(type -ap go); do
+ if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
+ goroot=$(GOROOT='' $go_exe env GOROOT)
+ if [ "$goroot" != "$GOROOT" ]; then
+ GOROOT_BOOTSTRAP=$goroot
+ fi
+ fi
+done
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
GOROOT = `{cd .. && pwd}
if(! ~ $#GOROOT_BOOTSTRAP 1)
GOROOT_BOOTSTRAP = $home/go1.4
+for(p in $path){
+ if(! test -x $GOROOT_BOOTSTRAP/bin/go){
+ if(go_exe = `{path=$p whatis go}){
+ goroot = `{GOROOT='' $go_exe env GOROOT}
+ if(! ~ $goroot $GOROOT){
+ GOROOT_BOOTSTRAP = $goroot
+ }
+ }
+ }
+}
if(! test -x $GOROOT_BOOTSTRAP/bin/go){
echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
exit bootstrap
}
+if(~ $GOROOT_BOOTSTRAP $GOROOT){
+ echo 'ERROR: $GOROOT_BOOTSTRAP must not be set to $GOROOT' >[1=2]
+ echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
+ exit bootstrap
+}
rm -f cmd/dist/dist
GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist