diff --git a/src/all.bat b/src/all.bat index d5abec141f..016987f86e 100644 --- a/src/all.bat +++ b/src/all.bat @@ -8,15 +8,15 @@ setlocal if exist make.bat goto ok echo all.bat must be run from go\src -:: cannot exit: would kill parent command interpreter -goto end +exit /b 1 :ok call .\make.bat --no-banner --no-local -if %GOBUILDFAIL%==1 goto end +if errorlevel 1 goto fail call .\run.bat --no-rebuild --no-local -if %GOBUILDFAIL%==1 goto end +if errorlevel 1 goto fail "%GOTOOLDIR%/dist" banner +goto :eof -:end -if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL% +:fail +exit /b 1 diff --git a/src/clean.bat b/src/clean.bat index 6688b41e5e..ceba3a56cf 100644 --- a/src/clean.bat +++ b/src/clean.bat @@ -6,8 +6,6 @@ setlocal -set GOBUILDFAIL=0 - go tool dist env -w -p >env.bat if errorlevel 1 goto fail call .\env.bat @@ -23,10 +21,7 @@ goto fail "%GOBIN%\go" tool dist clean "%GOBIN%\go" clean -i cmd -goto end +goto :eof :fail -set GOBUILDFAIL=1 - -:end -if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL% +exit /b 1 diff --git a/src/make.bat b/src/make.bat index 3b5a4663dc..3a72a59470 100644 --- a/src/make.bat +++ b/src/make.bat @@ -47,8 +47,6 @@ if x%4==x--no-local goto nolocal setlocal :nolocal -set GOBUILDFAIL=0 - if exist make.bat goto ok echo Must run make.bat from Go src directory. goto fail @@ -180,5 +178,4 @@ echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go %bootgo%. :fail -set GOBUILDFAIL=1 -if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL% +exit /b 1 diff --git a/src/race.bat b/src/race.bat index d395e19f97..64510b6012 100644 --- a/src/race.bat +++ b/src/race.bat @@ -11,8 +11,7 @@ setlocal if exist make.bat goto ok echo race.bat must be run from go\src -:: cannot exit: would kill parent command interpreter -goto end +exit /b 1 :ok set GOROOT=%CD%\.. @@ -29,7 +28,7 @@ goto fail :continue call .\make.bat --no-banner --no-local -if %GOBUILDFAIL%==1 goto end +if errorlevel 1 goto fail echo # go install -race std go install -race std if errorlevel 1 goto fail @@ -37,15 +36,9 @@ if errorlevel 1 goto fail go tool dist test -race if errorlevel 1 goto fail -goto succ +echo All tests passed. +goto :eof :fail -set GOBUILDFAIL=1 echo Fail. -goto end - -:succ -echo All tests passed. - -:end -if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL% +exit /b 1 diff --git a/src/run.bat b/src/run.bat index 35c8ead8cb..8815a1109f 100644 --- a/src/run.bat +++ b/src/run.bat @@ -16,8 +16,6 @@ if x%2==x--no-local goto nolocal setlocal :nolocal -set GOBUILDFAIL=0 - set GOENV=off ..\bin\go tool dist env > env.bat if errorlevel 1 goto fail @@ -29,14 +27,12 @@ set GOPATH=c:\nonexist-gopath if x%1==x--no-rebuild goto norebuild ..\bin\go tool dist test --rebuild if errorlevel 1 goto fail -goto end +goto :eof :norebuild ..\bin\go tool dist test if errorlevel 1 goto fail -goto end +goto :eof :fail -set GOBUILDFAIL=1 - -:end +exit /b 1