summaryrefslogtreecommitdiff
path: root/src/make.bat
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2012-02-16 10:26:01 +1100
committerAlex Brainman <alex.brainman@gmail.com>2012-02-16 10:26:01 +1100
commit564fa6b42b1eff9eb285dffdd1050ac946c696fc (patch)
treeab7c7e9f108bbe00597c3ff1660ebc35761da2ad /src/make.bat
parentebbba63af64200dbf2bf51d1f79dfa0d68362f78 (diff)
downloadgo-564fa6b42b1eff9eb285dffdd1050ac946c696fc.tar.gz
build: keep environment variable changes local during Windows build
R=bradfitz, rsc CC=golang-dev http://codereview.appspot.com/5673048
Diffstat (limited to 'src/make.bat')
-rw-r--r--src/make.bat15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/make.bat b/src/make.bat
index 6618bc4ed..e6921aa79 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