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.

101 lines
2.8 KiB

  1. @if "%_echo%"=="" echo off
  2. setlocal
  3. if "%BUILD_OFFLINE%"=="1" goto :eof
  4. set PUB=%_NTDRIVE%%_NTROOT%\public
  5. call :edit_public public publish.log
  6. for %%i in (%BINARY_PUBLISH_PROJECTS%) do (
  7. echo Checking out binary drops generated in %%i project.
  8. call :edit_public %%i %%i_publish.log
  9. )
  10. goto :eof
  11. :edit_public
  12. if exist %PUB%\%1_CHANGENUM.SD goto GotPubChangeNum
  13. echo BUILDMSG: Error %PUB%\%1_CHANGENUM.SD is missing - Open a new razzle window and retry
  14. goto :eof
  15. :GotPubChangeNum
  16. if NOT exist %PUB%\%2 goto :eof
  17. call %RazzleToolPath%\SubmitNewPublicFiles.cmd add
  18. set _editlist=%TEMP%\edit_public_list_%RANDOM%
  19. set _sdresults=%TEMP%\sdresults_%RANDOM%
  20. set _publishlog=%PUB%\%2_%RANDOM%
  21. pushd %_NTDRIVE%%_NTROOT%\%1%
  22. if exist %_editlist% del /f %_editlist%
  23. move %_NTDRIVE%%_NTROOT%\public\%2 %_publishlog%
  24. for /f "tokens=2" %%i in (%_NTDRIVE%%_NTROOT%\public\%1%_CHANGENUM.SD) do (
  25. for /f %%X in (%_publishlog%) do (
  26. echo %%~fX>> %_editlist%
  27. )
  28. sd -s -x %_editlist% edit -c %%i > %_sdresults% 2>&1
  29. )
  30. set sderror=FALSE
  31. for /f %%x in ('findstr /c:"error:" %_sdresults%') do (
  32. set sderror=TRUE
  33. )
  34. if NOT "%sderror%" == "TRUE" (
  35. type %_publishlog% >> %_NTDRIVE%%_NTROOT%\public\publish.log-Finished
  36. del /f %_publishlog%
  37. ) else (
  38. echo BUILDMSG: Error attempting to publish files
  39. for /f "delims=" %%x in ('findstr /c:"error:" %_sdresults%') do (
  40. echo BUILDMSG: %%x
  41. )
  42. type %_sdresults%
  43. type %_publishlog% >>%_NTDRIVE%%_NTROOT%\public\%2
  44. goto Cleanup
  45. )
  46. REM See if there's any r/w files in public that aren't under source control
  47. REM We do this to try and catch people who publish w/o adding to publicchanges.txt
  48. REM or who dump into public w/o using publish. We skip this step if there's a problm
  49. REM accessing sd.
  50. for /f "tokens=2" %%i in (%_NTDRIVE%%_NTROOT%\public\%1%_CHANGENUM.SD) do (
  51. sd -s opened -c %%i -l > %_sdresults% 2>&1
  52. )
  53. for /f %%x in ('findstr /c:"error:" %_sdresults%') do (
  54. goto Cleanup
  55. )
  56. REM first mark all r/w files as "system"
  57. for /f %%i in ('dir /s /b /a:-r-d') do @attrib +s %%i
  58. REM Then mark all opened files as "not system" (do the two step because the sd results file
  59. REM currently starts with info: and the version field starts with '#'
  60. for /f "delims=#" %%i in (%_sdresults%) do @echo %%i>>%_sdresults%_temp
  61. for /f "tokens=2" %%i in (%_sdresults%_temp) do @attrib -s %%i
  62. del %_sdresults%_temp
  63. REM Get the special case files
  64. for /f %%i in ('dir /s /b /a:s-r publish*') do @attrib -s %%i
  65. REM what's left are the problem files.
  66. for /f %%i in ('dir /s /b /a:s') do (
  67. echo BUILDMSG: Error - "%%i" is not under source control - forget to use publish or update publicchanges.txt?
  68. @attrib -s %%i
  69. )
  70. :Cleanup
  71. if exist %_editlist% del /f %_editlist%
  72. if exist %_publishlog% del /f %_publishlog%
  73. if exist %_sdresults% del /f %_sdresults%
  74. popd
  75. endlocal