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
1.9 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM startthread.cmd
  5. REM helper script called by startcompress
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. if defined _CPCMAGIC goto CPCBegin
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. #!perl
  14. use strict;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use PbuildEnv;
  18. use ParseArgs;
  19. sub Usage { print<<USAGE; exit(1) }
  20. startthread -e <event prefix> -c <complist> [-l <language>]
  21. USAGE
  22. parseargs('?' => \&Usage,
  23. 'e:'=> \$ENV{EVENTPREFIX},
  24. 'c:'=> \$ENV{COMPLIST});
  25. # *** NEXT FEW LINES ARE TEMPLATE ***
  26. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  27. __END__
  28. :CPCBegin
  29. set _CPCMAGIC=
  30. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  31. REM *** BEGIN YOUR 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