diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2012-02-16 10:26:01 +1100 |
---|---|---|
committer | Alex Brainman <alex.brainman@gmail.com> | 2012-02-16 10:26:01 +1100 |
commit | 32cb495b185b50b08aea7fd9402ddf3152f1fda8 (patch) | |
tree | 4a2406bef4030456deb86c2598c2b8b4ef67c858 /src/make.bat | |
parent | 79db6ada48d09dbbf47c4fb0f49ebbd2a044a35b (diff) | |
download | go-32cb495b185b50b08aea7fd9402ddf3152f1fda8.tar.gz go-32cb495b185b50b08aea7fd9402ddf3152f1fda8.zip |
build: keep environment variable changes local during Windows build
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5673048
Diffstat (limited to 'src/make.bat')
-rw-r--r-- | src/make.bat | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/make.bat b/src/make.bat index 6618bc4ed9..e6921aa791 100644 --- a/src/make.bat +++ b/src/make.bat @@ -3,6 +3,13 @@ :: license that can be found in the LICENSE file. @echo off +:: Keep environment variables within this script +:: unless invoked with --no-local. +if x%1==x--no-local goto nolocal +if x%2==x--no-local goto nolocal +setlocal +:nolocal + set GOBUILDFAIL=0 if exist make.bat goto ok @@ -48,13 +55,11 @@ goto mainbuild :localbuild echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH% -set oldGOOS=%GOOS% -set oldGOARCH=%GOARCH% +setlocal set GOOS=%GOHOSTOS% set GOARCH=%GOHOSTARCH% %GOTOOLDIR%\go_bootstrap install -v std -set GOOS=%oldGOOS% -set GOARCH=%oldGOARCH% +endlocal if errorlevel 1 goto fail echo . @@ -65,7 +70,7 @@ if errorlevel 1 goto fail del %GOTOOLDIR%\go_bootstrap.exe echo . -if "x%1"=="x--no-banner" goto nobanner +if x%1==x--no-banner goto nobanner %GOTOOLDIR%\dist banner :nobanner |