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.

93 lines
2.7 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 %7 %8 %9
  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_norebase=1
  21. set mpatches_nochecksum=1
  22. set mpatches_crcname=1
  23. set mpatches_subdirs=1
  24. set mpatches_forest=1
  25. if not "%cache%"=="" set mpatches_cache=%cache%
  26. if "%oldsympath%"=="" set mpatches_nosymwarn=1
  27. if not "%oldsympath%"=="" set mpatches_oldsympath=%oldsympath%
  28. if not "%newsympath%"=="" set mpatches_newsympath=%newsympath%
  29. set mpatches_fallbacks=1
  30. rem Clean out any existing files in the target pool
  31. rd %targetpool% /s /q 2>nul
  32. md %targetpool%
  33. rem Build patches
  34. set mpatches_ >> %logfile%
  35. echo mpatches %forest% %newfiles% %targetpool% -files:%sourcelist% >> %logfile%
  36. mpatches %forest% %newfiles% %targetpool% -files:%sourcelist% >> %logfile%
  37. if not errorlevel 1 goto buildpsf
  38. :failedmpatches
  39. echo %~n0: MPATCHES failed: errorlevel %errorlevel%
  40. findstr /i "mpatches:" %logfile% > %logfile%.tmp
  41. type %logfile%.tmp >> %logfile%
  42. erase %logfile%.tmp
  43. goto leave
  44. rem Build the PSF
  45. :buildpsf
  46. if not exist %targetpool%\*._p* goto failedmpatches
  47. if "%psfname%"=="" goto nopsf
  48. if not "%psfcomment%"=="" set psfcomment=/Comment:"%psfcomment%"
  49. echo psfbuild /baselist:%sourcelist% %targetpool% %psfname% /subdirs %psfcomment% >> %logfile%
  50. psfbuild /baselist:%sourcelist% %targetpool% %psfname% /subdirs %psfcomment% >> %logfile%
  51. if not errorlevel 1 goto done
  52. :psffail
  53. echo %~n0: PSFBUILD failed: errorlevel %errorlevel%
  54. goto leave
  55. :nopsf
  56. echo %~n0 finished, no PSF generated
  57. goto leave
  58. :done
  59. if not exist %psfname% goto psffail
  60. echo %~n0 finished %psfname%
  61. :leave
  62. echo %~n0: end %date% %time% >> %logfile%
  63. endlocal