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.

96 lines
2.8 KiB

  1. @setlocal
  2. @if "%_echo%" == "" echo off
  3. set bldtools=%~dp0
  4. path %bldtools%;%path%
  5. call %1 %1 %2 %3 %4 %5
  6. set logfile=%logpath%\%~n0.log
  7. for %%f in (%logfile%) do mkdir %%~dpf 2>nul
  8. echo %~n0: start %date% %time% > %logfile%
  9. if not "%cache%"=="" for %%f in (%cache%\z) do mkdir %%~dpf 2>nul
  10. if not "%psfname%"=="" for %%f in (%psfname%) do mkdir %%~dpf 2>nul
  11. if not "%psfname%"=="" if exist "%psfname%" erase "%psfname%"
  12. call %bldtools%\setlog %loglinkpath% %logpath%
  13. rem We don't want any unexpected mpatches env values to affect what we're
  14. rem doing, so delete all mpatches env values, then set the ones we do want.
  15. set mpatches_xxx=1
  16. for /F "delims==" %%i in ('set mpatches_') do @set %%i=
  17. rem Set all needed mpatches options
  18. set mpatches_nocompare=1
  19. set mpatches_nosymfail=1
  20. set mpatches_nochecksum=1
  21. set mpatches_crcname=1
  22. set mpatches_subdirs=1
  23. set mpatches_forest=1
  24. if not "%cache%"=="" set mpatches_cache=%cache%
  25. if "%oldsympath%"=="" set mpatches_nosymwarn=1
  26. if not "%oldsympath%"=="" set mpatches_oldsympath=%oldsympath%
  27. if not "%newsympath%"=="" set mpatches_newsympath=%newsympath%
  28. set mpatches_fallbacks=1
  29. set mpatches_map=%logpath%\%~n0.map
  30. set mpatches_mspatcha_winxp=1
  31. set mpatches_psymcache=%symcache%
  32. set mpatches_noaffinity=1
  33. rem Clean out any existing files in the target pool
  34. rd %targetpool% /s /q 2>nul
  35. md %targetpool%
  36. rem Build patches
  37. set mpatches_ >> %logfile%
  38. echo mpatches %forest% %newfiles% %targetpool% -files:%sourcelist% >> %logfile%
  39. mpatches %forest% %newfiles% %targetpool% -files:%sourcelist% >> %logfile%
  40. if not errorlevel 1 goto buildpsf
  41. :failedmpatches
  42. echo %~n0: MPATCHES failed: errorlevel %errorlevel%
  43. findstr /i "mpatches:" %logfile% > %logfile%.tmp
  44. type %logfile%.tmp >> %logfile%
  45. erase %logfile%.tmp
  46. goto leave
  47. rem Build the PSF
  48. :buildpsf
  49. if not exist %targetpool%\*._p* goto failedmpatches
  50. if "%psfname%"=="" goto nopsf
  51. if not "%psfcomment%"=="" set psfcomment=/Comment:"%psfcomment%"
  52. echo psfbuild /baselist:%sourcelist% %targetpool% %psfname% /subdirs %psfcomment% >> %logfile%
  53. psfbuild /baselist:%sourcelist% %targetpool% %psfname% /subdirs %psfcomment% >> %logfile%
  54. if not errorlevel 1 goto done
  55. :psffail
  56. echo %~n0: PSFBUILD failed: errorlevel %errorlevel%
  57. goto leave
  58. :nopsf
  59. echo %~n0 finished, no PSF generated
  60. goto leave
  61. :done
  62. if not exist %psfname% goto psffail
  63. echo %~n0 finished %psfname%
  64. :leave
  65. echo %~n0: end %date% %time% >> %logfile%
  66. endlocal