Created
November 27, 2011 00:49
-
-
Save danderson/1396652 to your computer and use it in GitHub Desktop.
Utility scripts to maintain 32/64 bit builds of Go, and easily switch between them.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function go-switch() { | |
eval `command go-switch $@` | |
rehash | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [[ -z $1 ]]; then | |
echo "Usage: $0 386|amd64" | |
exit 1 | |
fi | |
case $1 in | |
386|amd64) | |
if [[ -e ~/go ]]; then | |
if [[ -L ~/go ]]; then | |
rm ~/go | |
else | |
echo "~/go exists and is not a symlink, aborting" | |
exit 1 | |
fi | |
fi | |
ln -s ~/go-builds/$1 ~/go | |
;; | |
*) | |
echo "Unknown arch $1" | |
exit 1 | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROOT=$HOME/go-builds | |
mkdir -p $ROOT | |
if [[ -d $ROOT/upstream ]]; then | |
(cd $ROOT/upstream && hg pull) | |
else | |
(cd $ROOT && hg clone https://go.googlecode.com/hg/ upstream) | |
fi | |
for arch in 386 amd64; do | |
( | |
cd $ROOT | |
rm -rf $arch | |
hg clone -u weekly upstream $arch | |
export GOROOT=$ROOT/$arch | |
export GOARCH=$arch | |
cd $GOROOT/src | |
./all.bash | |
)& | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment