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.

299 lines
8.5 KiB

  1. @if "%_echo%"=="" echo off
  2. if "%1" == "" goto usage
  3. if "%2" == "" goto usage
  4. if "%3" == "" goto usage
  5. if "%4" == "" goto usage
  6. if "%5" == "" goto usage
  7. if "%6" == "" goto usage
  8. if "%7" == "" goto usage
  9. if not "%8" == "" goto usage
  10. rem patchpath is the root of the patch build directory.
  11. set patchpath=f:\xppatch
  12. set Product=wxp
  13. set OtherReleases=2600
  14. rem %1 = base name of this config file
  15. rem %2 = Q######
  16. set QNumber=%2
  17. if "%QNumber:~0,1%" == "q" set QNumber=Q%QNumber:~1%
  18. if not "%QNumber:~0,1%" == "Q" goto badQNumber
  19. goto goodQNumber
  20. :badQNumber
  21. echo Unexpected QNumber "%2"
  22. goto failed
  23. :goodQNumber
  24. rem %3 = language
  25. set ISOLang=
  26. for /f "tokens=1,2,3,4,7 delims=, " %%f in (%~dp0\language.lst) do call :CheckLanguage %3 %%f %%g %%h %%i %%j
  27. if not "%ISOLang%" == "" goto goodLanguage
  28. :badLanguage
  29. echo Unexpected Language "%3"
  30. goto failed
  31. :goodLanguage
  32. rem %4 = platform
  33. set Platform=i386
  34. if /i "%4" == "x86" goto goodPlatform
  35. if /i "%4" == "i386" goto goodPlatform
  36. set Platform=ia64
  37. if /i "%4" == "ia64" goto goodPlatform
  38. set Platform=nec98
  39. if /i "%4" == "nec98" if %ISOLang% == JA goto goodPlatform
  40. :badPlatform
  41. echo Unexpected Platform "%4"
  42. goto failed
  43. :goodPlatform
  44. rem %5 = bug#
  45. set BugNumber=%5
  46. rem %6 = SP#
  47. set SPNumber=%6
  48. if /i "%SPNumber:~0,2%" == "SP" set SPNumber=SP%SPNumber:~2%
  49. if "%SPNumber:~0,2%" == "SP" goto goodSPNumber
  50. :badSPNumber
  51. echo Unexpected SPNumber "%6" (format: "SP#")
  52. goto failed
  53. :goodSPNumber
  54. rem %7 = release code
  55. set RelCode=test
  56. if /i "%7" == "test" goto goodRelCode
  57. set RelCode=beta
  58. if /i "%7" == "beta" goto goodRelCode
  59. set RelCode=rtm
  60. if /i "%7" == "rtm" goto goodRelCode
  61. :badRelCode
  62. echo Unexpected release code "%7" (expected test, beta, or rtm)
  63. goto failed
  64. :goodRelCode
  65. rem newbuild is the name of the directory where the current build's
  66. rem compressed files can be found.
  67. set newbuild=%ReleaseShare%\%SPNumber%\%BugNumber%\2600\free\%CPRLang%\%Platform%
  68. rem newexe is the name of the self-extracting EXE containing the new build
  69. set newexe=%QNumber%_%Product%_%SPNumber%_%Platform:i386=x86%_%CPRLang%.exe
  70. rem servername is the name of the pstream server
  71. rem This forms part of the URL in the built file update.url.
  72. rem No build-machine entry is required here unless you will prop your
  73. rem build, but to a machine other than the build machine.
  74. set servername=%ComputerName%
  75. if /i %ComputerName%==msliger0 set servername=msliger7
  76. if /i %RelCode%=="rtm" set servername=ntservicepack.microsoft.com
  77. rem psfroot is the destination path for built PSF files
  78. rem A specific build-machine entry is required here only if you want to prop your build.
  79. if /i %ComputerName%==winsebld set psfroot=d:\psfroot\xp
  80. if /i %ComputerName%==msliger0 set psfroot=\\%servername%\psfroot$\xp
  81. if /i %ComputerName%==msliger3 set psfroot=c:\psfroot\xp
  82. rem wwwroot is the destination path for built EXE files
  83. rem A specific build-machine entry is required here only if you want to prop your build.
  84. if /i %ComputerName%==winsebld set wwwroot=d:\wwwroot\hotfix_xp
  85. if /i %ComputerName%==msliger0 set wwwroot=\\%servername%\wwwroot$\hotfix_xp
  86. if /i %ComputerName%==msliger3 set wwwroot=c:\wwwroot\hotfix_xp
  87. rem patchbuild is the directory where the finished files will go.
  88. set patchbuild=%patchpath%\build\%Language%\%BugNumber%\%Platform%
  89. rem patchtemp is a directory where intermediate files are built.
  90. set patchtemp=%patchpath%\temp\%Language%
  91. rem logpath is the name of the directory where log files go.
  92. set logpath=%patchbuild%\logs
  93. rem loglinkpath is the name of the directory of the link to the latest log files.
  94. set loglinkpath=%patchpath%\build\%Language%
  95. rem forest is the name of the directory where all patch reference
  96. rem files (from previous and current build) can be found. Ideally,
  97. rem there will be a manifest file at the base of each tree in the forest.
  98. set forest=%patchpath%\forest\%Language%\%Platform%
  99. rem newfiles is the name of the directory where all the current
  100. rem build's files (fully uncompressed) can be located. Every file named
  101. rem in the sourcelist must exist in this directory.
  102. set newfiles=%forest%\stage\%BugNumber%
  103. rem patching is the name of the override directory where the
  104. rem current build's patch-only files (update.url and patching
  105. rem flavor of update.ver) can be located. Any file found in
  106. rem in this directory will override the file from newfiles.
  107. set patching=%patchtemp%
  108. rem psfname is the full pathname of the PSF
  109. set psfname=%patchbuild%\%QNumber%.%Platform%.%Language%.psf
  110. rem cablist is the list of cab files which can be built from update.url
  111. set cablist=
  112. rem template is the full pathname of updateurl.template
  113. set template=%bldtools%\hotfixurl.template
  114. rem patchexe is the name of the patch EXE to be produced
  115. set patchexe=patch.%QNumber%.%Platform%.%Language%.exe
  116. if %RelCode%==test set patchexe=%patchbuild%\%patchexe%
  117. if %RelCode%==beta set patchexe=%patchbuild%\beta\%patchexe%
  118. if %RelCode%==rtm set patchexe=%patchbuild%\rtw\%patchexe%
  119. rem patchddf is the name of the patch DDF to be produced.
  120. set patchddf=%patchtemp%\patch.ddf
  121. rem patchcab is the name of the patch CAB to be produced.
  122. set patchcab=%patchtemp%\patch.cab
  123. rem stubexe is the full pathname of the self-extracting stub.
  124. rem set stubexe=%bldtools%\%ISOLang%\%platform:i386=x86%\sfxstub.exe
  125. set stubexe=%bldtools%\%platform:i386=x86%\sfxmini.exe
  126. rem server is the full URL prefix of the patch server including the
  127. rem ISAPI pstream.dll name
  128. set server=http://%servername%/isapi/pstream3.dll/xp
  129. rem updatever is the name of the update.ver file.
  130. set updatever=update.ver
  131. rem sourcelist is the name of a text file containing the names of all
  132. rem the files which could be downloaded. Usually derived from the
  133. rem [SourceDisksFiles] sections in update.inf and update.url
  134. set sourcelist=%patchtemp%\update\%updatever%
  135. rem targetpool is the name of the directory where all the produced
  136. rem patches will be collected. Existing contents of this directory
  137. rem will be deleted.
  138. set targetpool=%patchpath%\patches.out\%Language%
  139. rem cache is the name of the directory where mpatches can look for
  140. rem previously-built patch files. Any new patches built will be added
  141. rem to this directory.
  142. set cache=%patchpath%\PatchCache
  143. rem psfcomment is a comment to go in the produced PSF.
  144. set psfcomment=%newbuild% %newexe% (%COMPUTERNAME%)
  145. rem oldsympath is the symbol path for "old" files
  146. set strcat=
  147. for %%p in (%OtherReleases%) do call :strcat %forest%\history\%%p\symbols
  148. set oldsympath=%strcat%;%newfiles%\symbols
  149. rem newsympath is the symbol path for "new" files
  150. set strcat=%newfiles%\symbols
  151. for %%p in (%OtherReleases%) do call :strcat %forest%\history\%%p\symbols
  152. set newsympath=%strcat%
  153. set strcat=
  154. rem forest check
  155. if exist %forest%\history goto :EOF
  156. echo Error: Forest not populated for %Language%\%Platform%
  157. goto failed
  158. :strcat
  159. if not "%strcat%"=="" set strcat=%strcat%;
  160. set strcat=%strcat%%1
  161. goto :EOF
  162. rem :CheckLanguage <given> <Language> <Equiv1> <Equiv2> <CPRLang> <ISOLang>
  163. :CheckLanguage
  164. if /i "%1" == "%2" goto :SetLanguage
  165. if /i "%1" == "%3" goto :SetLanguage
  166. if /i "%1" == "%4" goto :SetLanguage
  167. if /i "%1" == "%5" goto :SetLanguage
  168. if /i "%1" == "%6" goto :SetLanguage
  169. goto :EOF
  170. :SetLanguage
  171. set Language=%2
  172. set ISOLang=%6
  173. set CPRLang=%5
  174. goto :EOF
  175. :Usage
  176. echo.
  177. echo %~n0: Parameters: {verb} {config} {Q######} {language} {platform} {bug#} {SP#} {relcode}
  178. echo.
  179. echo verb operation to perform
  180. echo config base name of this configuration file (%~n0)
  181. echo Q###### Package's KB article ID, ie, "Q123456"
  182. echo language any language code from in %~dp0languages.lst, ie, "EN"
  183. echo platform i386/x86, ia64, nec98
  184. echo bug# RAID package request bug#, ie, 22002
  185. echo SP# package's pre-SP#, ie, "SP1"
  186. echo relcode one of: test, beta, RTM
  187. goto failed
  188. :failed
  189. set language=
  190. set ISOLang=
  191. set platform=
  192. set forest=
  193. set newbuild=
  194. set server=
  195. set newfiles=