]> Cypherpunks repositories - gostls13.git/commitdiff
clean.bash: fix standalone runs
authorChristopher Wedgwood <cw@f00f.org>
Thu, 19 Aug 2010 04:09:11 +0000 (00:09 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 19 Aug 2010 04:09:11 +0000 (00:09 -0400)
R=rsc
CC=golang-dev
https://golang.org/cl/1933043

src/clean.bash

index 53fddd6c29135622c53d990ee6c58a41e74b35a8..a62f33998c508442ecc74a1c1119010ea41ddde9 100755 (executable)
@@ -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