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.

112 lines
3.7 KiB

  1. @echo off
  2. setlocal ENABLEDELAYEDEXPANSION
  3. if DEFINED _echo echo on
  4. if DEFINED verbose echo on
  5. REM ********************************************************************
  6. REM
  7. REM This script finds out which files in symbad.txt are either not found
  8. REM or pass symbol checking on all four build machines.
  9. REM
  10. REM It creates a new symbad.txt based on this build machine. Before
  11. REM checking in a new symbad.txt, you need to take the union of symbad.txt.new
  12. REM from all of the platforms.
  13. REM
  14. REM ********************************************************************
  15. set Symbad=%RazzleToolPath%\symbad.txt
  16. set SymDir=%_NTTREE%\symbad
  17. set ml=perl %RazzleToolPath%\makelist.pl
  18. if EXIST %SymDir% rd /s /q %SymDir%
  19. md %SymDir%
  20. REM Create a Symbad.txt that doesn't have any comments in it
  21. for /f "eol=; tokens=1" %%a in (%Symbad%) do (
  22. echo %%a>> %SymDir%\symbad.txt.old2
  23. )
  24. sort %SymDir%\symbad.txt.old2 >%SymDir%\symbad.txt.old
  25. REM Create a list for each of the ones that pass symbol checking
  26. echo Examining files on %_NTTREE%
  27. for /f %%b in (%SymDir%\symbad.txt.old) do (
  28. if /i EXIST %_NTTREE%\%%b (
  29. symchk.exe %_NTTREE%\%%b /s %_NTTREE%\symbols\retail /v | findstr PASSED | findstr -v IGNORED >> %SymDir%\symchk.tmp
  30. ) else (
  31. REM if
  32. echo SYMCHK: %%b PASSED NOT FOUND >> %SymDir%\symchk.tmp
  33. )
  34. )
  35. REM Strip everything out except for the file name
  36. for /f "tokens=2 delims= " %%c in (%SymDir%\symchk.tmp) do (
  37. echo %%c>> %SymDir%\all.pass
  38. )
  39. REM Special case for zero-length file, make sure that a zero length
  40. REM file is at least there for later code
  41. if NOT EXIST %SymDir%\all.pass copy %SymDir%\symchk.tmp %SymDir%\all.pass
  42. echo All files that passed or were not found are in %SymDir%\all.pass
  43. sort %SymDir%\all.pass > %SymDir%\all.passed
  44. REM
  45. REM Find the difference between the original symbad.txt and the files
  46. REM that just passed symbol checking on all platforms. Note: symbad.txt.old
  47. REM is symbad.txt without the comments.
  48. REM
  49. REM Save the list in %SymDir%\symbad.txt.tmp
  50. REM
  51. echo Calculating the new symbad.txt
  52. %ml% -d %SymDir%\symbad.txt.old %SymDir%\all.passed -o %SymDir%\symbad.txt.tmp2
  53. sort %SymDir%\symbad.txt.tmp2 > %SymDir%\symbad.txt.tmp
  54. del %SymDir%\symbad.txt.tmp2
  55. REM
  56. REM Now, save all the comments that were in the original symbad.txt
  57. REM Copy the new symbad.txt that can be checked in to
  58. REM RazzleToolPath\symbad.txt
  59. REM
  60. REM BUGBUG!! Wx86 can be taken out after all of the wx86 files are cleaned
  61. REM out of symbad.txt
  62. echo Restoring the comments from original symbad.txt
  63. for /f %%a in (%SymDir%\symbad.txt.tmp) do (
  64. findstr /i %%a %Symbad% | findstr /v "Wx86" >> %SymDir%\symbad.txt.new2
  65. )
  66. REM Everything is great except that there could be duplicate lines in the file
  67. sort %SymDir%\symbad.txt.new2 > %SymDir%\symbad.txt.new3
  68. set prev=
  69. for /f "tokens=1 delims=" %%a in (%SymDir%\symbad.txt.new3) do (
  70. if /i NOT "%%a" == "!prev!" echo %%a>> %SymDir%\symbad.txt.new
  71. set prev=%%a
  72. )
  73. REM BUGBUG!! Add acmsetup.exe and mssetup.dll back
  74. REM This is a bug that the TS group needs to fix. This can be
  75. REM removed when they get their bug fixed. They rename retail
  76. REM in their placefil.txt. Thus, even though these don't get
  77. REM binplaced to binaries, build.exe thinks they do and says they
  78. REM have symbol errors
  79. echo acmsetup.exe ; tsext\client\setup>> %SymDir%\symbad.txt.new
  80. echo mssetup.dll ; tsext\client\setup>> %SymDir%\symbad.txt.new
  81. REM Add the 64-bit files back in
  82. REM findstr "64-bit" %Symbad% >> %SymDir%\symbad.txt.new
  83. REM Add the international files back in
  84. findstr /i "INTL" %Symbad% >> %SymDir%\symbad.txt.new
  85. REM Sort the final list
  86. sort %SymDir%\symbad.txt.new > %SymDir%\symbad.txt.sorted
  87. copy %SymDir%\symbad.txt.sorted %SymDir%\symbad.txt.new
  88. echo New symbad.txt = %SymDir%\symbad.txt.new
  89. endlocal