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.

83 lines
2.0 KiB

  1. @REM standard cmd script header lines ...
  2. @echo off
  3. setlocal EnableDelayedExpansion
  4. REM
  5. REM fullsync.cmd
  6. REM
  7. REM this script will kick off a parallel sync in all projects
  8. REM
  9. REM set up local vars
  10. set /a ExitCode=0
  11. set LogFile=%SDXROOT%\fullsync.err
  12. REM make sure we know where we are
  13. if not defined SDXROOT (
  14. echo SDXROOT is not defined, exiting.
  15. set /a ExitCode=!ExitCode! + 1
  16. goto :ErrEnd
  17. )
  18. REM clear the error log if any
  19. if exist %LogFile% del %LogFile%
  20. REM the dot in ProjectList is for the root depot
  21. REM set ProjectList=. admin base com drivers ds enduser inetcore inetsrv multimedia net printscan sdktools shell termsrv windows
  22. REM generate the project list from sd.map
  23. set ReadFlag=FALSE
  24. set ProjectList=
  25. for /f "tokens=1,2 delims==" %%a in (%SDXROOT%\sd.map) do (
  26. set TokenOne=%%a
  27. set TokenTwo=%%b
  28. set TokenOne=!TokenOne: =!
  29. set TokenTwo=!TokenTwo: =!
  30. if /i "!TokenOne!" == "DEPOTS" set ReadFlag=FALSE
  31. if "!TokenOne!" NEQ "#" (
  32. if "!TokenTwo!" NEQ "" (
  33. if "!ReadFlag!" == "TRUE" (
  34. if defined ProjectList (set ProjectList=!ProjectList! !TokenOne!-!TokenTwo!) else (set ProjectList=!TokenOne!-!TokenTwo!)
  35. )
  36. )
  37. )
  38. if /i "!TokenOne!" == "CLIENT" set ReadFlag=TRUE
  39. )
  40. set WaitList=
  41. for %%a in (%ProjectList%) do (
  42. for /f "tokens=1,2 delims=-" %%b in ('echo %%a') do (
  43. if "%%c" NEQ "" (
  44. pushd %SDXROOT%\%%c
  45. start "%%b syncing" /MIN cmd /c %RazzleToolPath%\PostBuildScripts\syncone.cmd %%c
  46. if defined WaitList (set WaitList=!WaitList! syncwait.%%c) else (set WaitList=syncwait.%%c)
  47. popd
  48. )
  49. )
  50. )
  51. set waitlist=%waitlist:\=-%
  52. perl %RazzleToolPath%\PostBuildScripts\cmdevt.pl -wv %WaitList%
  53. echo.
  54. if exist %LogFile% (
  55. echo Errors encountered:
  56. echo see %LogFile% for details.
  57. set /a ExitCode=!ExitCode! + 1
  58. goto :ErrEnd
  59. )
  60. echo No errors encountered.
  61. goto :End
  62. :End
  63. endlocal
  64. goto :EOF
  65. :ErrEnd
  66. echo Finished with %ExitCode% error(s).
  67. call :End
  68. seterror.exe 1