Source code of Windows XP (NT5)
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.

95 lines
2.2 KiB

  1. @echo off
  2. setlocal EnableDelayedExpansion
  3. REM Parse the command line
  4. set BuildPlatform=
  5. set Language=
  6. :SwitchLoop
  7. for %%a in (./ .- .) do if ".%1." == "%%a?." goto :Usage
  8. if "%1" == "" goto :EndSwitchLoop
  9. for /f "tokens=1,2 delims=:" %%a in ('echo %1') do (
  10. set Switch=%%a
  11. set Arg=%%b
  12. for %%c in (./ .-) do (
  13. if ".!Switch!." == "%%cp." (set BuildPlatform=!Arg!&&goto :ShiftArg)
  14. if ".!Switch!." == "%%cl." (set Language=!Arg!&&goto :ShiftArg)
  15. )
  16. )
  17. REM if we got here, we had an unrecognized option
  18. goto :Usage
  19. :ShiftArg
  20. shift
  21. goto :SwitchLoop
  22. :EndSwitchLoop
  23. REM validate cmdline args
  24. if not defined BuildPlatform goto :Usage
  25. if not defined Language set Language=usa
  26. REM set local vars
  27. for %%a in (%0) do set SCRIPT_NAME=%%~na
  28. if not defined LOGFILE set LOGFILE=%SCRIPT_NAME%.log
  29. REM now do the dirty work
  30. REM first, look for the relrules file
  31. if not defined RazzleToolPath (
  32. echo RazzleToolPath is not defined, exiting.
  33. goto :ErrEnd
  34. )
  35. if not exist %RazzleToolPath%\PostBuildScripts\relrules.%_BuildBranch% (
  36. echo No RelRules file found for this branch.
  37. goto :ErrEnd
  38. )
  39. REM if we're here, we have a relrules file
  40. set ReadMe=
  41. set ReleaseServers=
  42. for /f "tokens=1,3*" %%a in (%RazzleToolPath%\PostBuildScripts\relrules.%_BuildBranch%) do (
  43. if "%%b" == "" set ReadMe=
  44. if "!ReadMe!" == "TRUE" (
  45. if /i "%%b" == "%Language%," set ReleaseServers=%%c
  46. ) else (
  47. if "%%a" == "%BuildPlatform%:" (
  48. set ReadMe=TRUE
  49. ) else (
  50. set ReadMe=
  51. )
  52. )
  53. )
  54. REM now, if releaseservers is defined, we found everything we need
  55. REM if not, this language/archtype is not archived.
  56. if not defined ReleaseServers (
  57. echo This archtype / language is not archived.
  58. goto :ErrEnd
  59. )
  60. echo This language / archtype is archived.
  61. goto :End
  62. :Usage
  63. echo.
  64. echo %0 ^<-p:archtype^>
  65. echo.
  66. echo -p:archtype perform query for build platform and type "archtype"
  67. echo e.g. ia64chk or amd64fre
  68. echo.
  69. echo %0 will check if the specified archtype is archived for this branch.
  70. echo if so, it will set the exit code to zero. if not, it will set the
  71. echo exit code to non-zero.
  72. echo.
  73. goto :ErrEnd
  74. :End
  75. endlocal
  76. goto :EOF
  77. :ErrEnd
  78. endlocal
  79. seterror.exe 1