diff options
author | Christopher Wedgwood <cw@f00f.org> | 2010-08-19 00:09:11 -0400 |
---|---|---|
committer | Christopher Wedgwood <cw@f00f.org> | 2010-08-19 00:09:11 -0400 |
commit | a01448a7ca54f14f09c4f480a1544f9112af5c7d (patch) | |
tree | 001cbbf5dc8622193e4538956a63b7ab9743fde7 /src/clean.bash | |
parent | ed4d1260677407dad07b0a2495b2c0bb1f4fc389 (diff) | |
download | go-a01448a7ca54f14f09c4f480a1544f9112af5c7d.tar.gz |
clean.bash: fix standalone runs
R=rsc
CC=golang-dev
http://codereview.appspot.com/1933043
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/clean.bash')
-rwxr-xr-x | src/clean.bash | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/clean.bash b/src/clean.bash index 53fddd6c2..a62f33998 100755 --- a/src/clean.bash +++ b/src/clean.bash @@ -5,21 +5,16 @@ set -e -if [ -z "$GOROOT" ] ; then - echo '$GOROOT not set' +if [ ! -f env.bash ]; then + echo 'clean.bash must be run from $GOROOT/src' 1>&2 exit 1 fi -if [ -z "$GOOS" ] ; then - echo '$GOOS not set' - exit 1 -fi -if [ -z "$GOARCH" ] ; then - echo '$GOARCH not set' - exit 1 +. ./env.bash +if [ ! -f Make.inc ] ; then + GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT} + sed 's!@@GOROOT@@!'"$GOROOT_FINAL"'!' Make.inc.in >Make.inc fi -GOBIN="${GOBIN:-$HOME/bin}" - if [ "$1" != "--nopkg" ]; then rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH fi |