Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.3 KiB

  1. @echo off
  2. if defined _echo0 echo on
  3. if defined verbose0 echo on
  4. setlocal ENABLEEXTENSIONS
  5. REM ---------------------------------------------------------
  6. REM IsIntlBld.cmd
  7. REM Verifies if the environment is an International build
  8. REM environment of the given site (if specified).
  9. REM See usage for more details.
  10. REM ---------------------------------------------------------
  11. REM Define exitcode values
  12. set EXIT_SUCCESS=0
  13. set EXIT_ERROR_NOT_INTL=1
  14. set EXIT_ERROR_WRONG_SITE=2
  15. REM Initialize exitcode
  16. set exitcode=%EXIT_SUCCESS%
  17. REM Define SCRIPT_NAME. Used by the logging scripts.
  18. for %%i in (%0) do set script_name=%%~ni.cmd
  19. REM Provide usage.
  20. for %%a in (./ .- .) do if ".%1." == "%%a?." goto Usage
  21. call :CheckEnv %1
  22. set exitcode=%ERRORLEVEL%
  23. goto :end
  24. REM ------------------
  25. REM Procedure: CheckEnv
  26. REM ------------------
  27. :CheckEnv
  28. REM
  29. REM The International build environment
  30. REM defines the "INTERNATIONAL" variable.
  31. REM
  32. if not defined INTERNATIONAL (
  33. seterror.exe "%EXIT_ERROR_NOT_INTL%"
  34. goto :EOF
  35. )
  36. REM
  37. REM Redmond and Dublin-based International builds
  38. REM define SITE in their environment, according to
  39. REM their location.
  40. REM
  41. if "%1" == "" (
  42. seterror.exe "%EXIT_SUCCESS%"
  43. goto :EOF
  44. )
  45. if /i NOT "%1" == "%SITE%" (
  46. seterror.exe "%EXIT_ERROR_WRONG_SITE%"
  47. goto :EOF
  48. )
  49. seterror.exe "%EXIT_SUCCESS%"
  50. goto :EOF
  51. REM ------------------
  52. REM Display usage
  53. REM ------------------
  54. :Usage
  55. echo %SCRIPT_NAME% - Determines whether the current
  56. echo build environment is international (INTL).
  57. echo.
  58. echo usage: %SCRIPT_NAME% [Redmond^|Dublin]
  59. echo.
  60. echo If called with no parameters, it checks whether the current environment
  61. echo is an INTL build environment.
  62. echo If the environment is INTL, ERRORLEVEL is set to %EXIT_SUCCESS%.
  63. echo Otherwise, ERRORLEVEL is set to %EXIT_ERROR_NOT_INTL%.
  64. echo.
  65. echo If called with Redmond or Dublin as a parameter, it checks whether the
  66. echo current environment corresponds to an INTL build environment
  67. echo from the given site (Redmond or Dublin).
  68. echo If the current site matches the given parameter, ERRORLEVEL is set to %EXIT_SUCCESS%.
  69. echo Otherwise, ERRORLEVEL is set to %EXIT_ERROR_WRONG_SITE%.
  70. echo.
  71. :end
  72. endlocal & seterror.exe "%exitcode%"