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.

73 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. call %bldtools%\setlog %loglinkpath% %logpath%
  10. echo Cache cleanup... >> %logfile%
  11. if "%cache%" == "" echo No cache! >> %logfile%
  12. if "%cache%" == "" goto nocache
  13. rem This is very dangerous, so we'd like to make sure
  14. rem %cache% really is pointing where we think it is.
  15. rem We make sure there are no loose files there (only
  16. rem directories are expected), then make sure that certain
  17. rem subdirectories do exist.
  18. set block=
  19. (for /f %%f in ('dir %cache% /b /a-d') do set block=%%f) 2>nul
  20. if not "%block%"=="" echo Cache "%cache%" contains unexpected file(s) such as %block% >> %logfile%
  21. if not "%block%"=="" goto nocache
  22. if not exist "%cache%"\kernel32.dll echo Cache doesn't contain kernel32.dll directory >> %logfile%
  23. if not exist "%cache%"\kernel32.dll goto nocache
  24. if not exist "%cache%"\ntoskrnl.exe echo Cache doesn't contain ntoskrnl.exe directory >> %logfile%
  25. if not exist "%cache%"\ntoskrnl.exe goto nocache
  26. if not exist "%cache%"\layout.inf echo Cache doesn't contain layout.inf directory >> %logfile%
  27. if not exist "%cache%"\layout.inf goto nocache
  28. rem /s = include subdirectories
  29. rem /a# = delete files not ACCESSED in last # days
  30. echo dirclean %cache% /s /a10 >> %logfile%
  31. dirclean %cache% /s /a10 >> %logfile%
  32. :nocache
  33. echo Build cleanup... >> %logfile%
  34. if "%patchbuild%" == "" echo No build! >> %logfile%
  35. if "%patchbuild%" == "" goto nobuild
  36. rem This is very dangerous, so we make sure
  37. rem %patchbuild% really is pointing where we think it is.
  38. if not exist %patchbuild%\rtw echo Build target doesn't contain rtw directory >> %logfile%
  39. if not exist %patchbuild%\rtw goto nobuild
  40. if not exist %patchbuild%\*.exe echo Build target doesn't contain any .EXE files >> %logfile%
  41. if not exist %patchbuild%\*.exe goto nobuild
  42. if not exist %patchbuild%\*.psf echo Build target doesn't contain any .PSF files >> %logfile%
  43. if not exist %patchbuild%\*.psf goto nobuild
  44. rem /s = include subdirectories
  45. rem /m# = delete files not MODIFIED in last # days
  46. rem %patchbuild% contains a specific build number.
  47. rem Assumes that its siblings are other, older builds.
  48. echo dirclean %patchbuild%\.. /s /m10 >> %logfile%
  49. dirclean %patchbuild%\.. /s /m10 >> %logfile%
  50. :nobuild
  51. echo %~n0: end %date% %time% >> %logfile%
  52. endlocal