Leaked source code of windows server 2003
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 -----------------------------------------------------------------
  2. @REM
  3. @REM startthread.cmd - BPerkins
  4. @REM helper script called by startcompress
  5. @REM
  6. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. @REM
  8. @REM -----------------------------------------------------------------
  9. @if defined _CPCMAGIC goto CPCBegin
  10. @perl -x "%~f0" %*
  11. @goto :EOF
  12. #!perl
  13. use strict;
  14. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  15. use lib $ENV{RAZZLETOOLPATH};
  16. use PbuildEnv;
  17. use ParseArgs;
  18. sub Usage { print<<USAGE; exit(1) }
  19. startthread -e <event prefix> -c <complist> [-l <language>]
  20. USAGE
  21. parseargs('?' => \&Usage,
  22. 'e:'=> \$ENV{EVENTPREFIX},
  23. 'c:'=> \$ENV{COMPLIST});
  24. # *** TEMPLATE CODE ***
  25. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  26. __END__
  27. @:CPCBegin
  28. @set _CPCMAGIC=
  29. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  30. @if not defined DEBUG echo off
  31. @REM *** CMD SCRIPT BELOW ***
  32. set EventName=
  33. for %%a in (%CompList%) do (
  34. for %%b in (%%~xa) do set CompListNumber=%%b
  35. )
  36. for %%i in (%CompList%) do set CompListName=%%~nxi
  37. if not exist %tmp%\compression md %tmp%\compression
  38. echotime /t "Compress files in %CompList%">%tmp%\compression\%CompListName%.tmp
  39. set EventName=!EventPrefix!comp!CompListNumber!
  40. call logmsg.cmd "Event name is !EventName! ..."
  41. echo about to compress ...
  42. call ExecuteCmd.cmd "compress -d -zx21 -s @%CompList%"
  43. echo done with compression.
  44. del /f %tmp%\compression\%CompListName%.tmp
  45. if "%errorlevel%" == "1" goto end
  46. goto end
  47. REM
  48. REM Send an event to the parent script
  49. REM
  50. :SendEvent
  51. if defined EventName (
  52. echo Holding for !EventName! ...
  53. perl %RazzleToolPath%\PostBuildScripts\cmdevt.pl -ivh !EventName!
  54. echo Sending !EventName! ...
  55. perl %RazzleToolPath%\PostBuildScripts\cmdevt.pl -ivs !EventName!
  56. echo Event !EventName! is cleared.
  57. set EventName=
  58. )
  59. goto :EOF
  60. :end
  61. call :SendEvent
  62. seterror.exe "%errors%"& goto :EOF