From bdeebf4907cba7d6328d04bdfacf49aa2430831f Mon Sep 17 00:00:00 2001 From: Christopher Wedgwood Date: Thu, 19 Aug 2010 00:09:11 -0400 Subject: [PATCH] clean.bash: fix standalone runs R=rsc CC=golang-dev https://golang.org/cl/1933043 --- src/clean.bash | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/clean.bash b/src/clean.bash index 53fddd6c29..a62f33998c 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 -- 2.50.0