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.

606 lines
19 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM <<srvrel.cmd>>
  4. REM copy the build From Build Machine to Release Servers.
  5. REM
  6. REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. REM Version: < 1.0 > 02/02/2001 Suemiao Rossignol
  8. REM ------------------------------------------------------------------
  9. perl -x "%~f0" %*
  10. goto :EOF
  11. #!perl
  12. use strict;
  13. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  14. use lib $ENV{RAZZLETOOLPATH};
  15. use Logmsg;
  16. use ParseArgs;
  17. use File::Basename;
  18. use BuildName;
  19. use GetIniSetting;
  20. use comlib;
  21. use cksku;
  22. my $scriptname = basename( $0 );
  23. sub Usage {
  24. print<<USAGE;
  25. Propagate builds to release servers.
  26. Usage:
  27. $scriptname: -l:<language> [-b:<BuildName>] [-p]
  28. -l Language.
  29. Default is "usa".
  30. -b Build Name.
  31. Default is defined in
  32. <ReleaseShare>\\<buildName>\\build_logs\\buildname.txt for language usa.
  33. <ReleaseShare>\\<lang>\\<buildName>\\build_logs\\buildname.txt for language none usa.
  34. -r Alternate source server other than build machine.
  35. Replace build machine if this is defined.
  36. -p Powerless.
  37. Display key variables only.
  38. -? Display Usage.
  39. Example:
  40. $scriptname -b:2415.x86fre.main.001222-1745
  41. $scriptname -l:ger -p
  42. USAGE
  43. exit(1)
  44. }
  45. my ( $lang, $buildName, $powerLess, $buildBranch, $buildArch, $buildType, $iniFile );
  46. my ( $buildNo, @buildMachines, @releaseServers, $remoteName, $computerName );
  47. my ( $releaseShareName, $releaseShareRootDir, $releaseResDir, @releaseAccess );
  48. my ( $latestReleaseShareName, $pullResDir, $pushResDir);
  49. my ( $buildMachineReleaseShareName,$freeSpaceReq, $numBuildToKeep, $fileLock);
  50. my ( @mConglomerators, $isConglomerator, $releaseResRootDir );
  51. my ( $tmpPostBldDir, $postBldToolDir );
  52. my ( $buildTime, @group, %groupShareName, %groupShareRootDir, $releaseDrive );
  53. my ( $srcServer, $symFarm );
  54. my ( %validSkus, @validSkus );
  55. &GetParams();
  56. if( !&InitVars() ) { exit(1); }
  57. if( !$powerLess && !&VerifyDiskSpace ) { exit(1); }
  58. if( !$powerLess && !&DeletePublicShare) { exit(1); }
  59. if( !$powerLess && !&PurgeOldCdimage ) { exit(1); }
  60. if( !&LoopPullServers ){ exit(1); }
  61. if( !$powerLess && !&CreatePublicShare) { exit(1); }
  62. timemsg( "Complete [$scriptname]" );
  63. exit(0);
  64. #-----------------------------------------------------------------------------
  65. sub GetParams
  66. {
  67. parseargs('?' => \&Usage, 'b:' => \$buildName,'l:' =>\$ENV{lang}, 'r:' => \$srcServer, 'p' =>\$powerLess );
  68. $ENV{lang} = "usa" if( !$ENV{lang} );
  69. $lang = $ENV{lang};
  70. }
  71. #-----------------------------------------------------------------------------
  72. sub InitVars
  73. {
  74. my( @iniRequest, $iniBuildMachine );
  75. #####Get ENV Variables
  76. $computerName = $ENV{computername};
  77. #####Set build name, Number, Branch, Archtecture, Type and ini file
  78. if( !$buildName )
  79. {
  80. if( ! ($buildName = build_name() ))
  81. {
  82. my ($cmdLine ) = "$ENV{RazzleToolPath}\\postbuildscripts\\getlatestrelease.cmd -l:$lang";
  83. return 0 if( !chomp(($buildName= `$cmdLine`)) );
  84. }
  85. }
  86. #####Set LogFile & ErrFile
  87. $ENV{temp} = "$ENV{temp}\\$lang\\$buildName";
  88. system( "md $ENV{temp}" ) if( !(-e $ENV{temp} ) );
  89. $ENV{LOGFILE} = "$ENV{temp}\\srvrel.log";
  90. $ENV{ERRFILE} = "$ENV{temp}\\srvrel.err";
  91. if(-e $ENV{LOGFILE} )
  92. {
  93. system( "copy $ENV{LOGFILE} $ENV{LOGFILE}.old");
  94. system( "del $ENV{LOGFILE}" );
  95. }
  96. if(-e $ENV{ERRFILE} )
  97. {
  98. system( "copy $ENV{ERRFILE} $ENV{ERRFILE}.old") ;
  99. system( "del $ENV{ERRFILE}" );
  100. }
  101. timemsg( "Start [$scriptname]" );
  102. $buildNo = build_number($buildName);
  103. $buildBranch = build_branch($buildName);
  104. $buildArch = build_arch($buildName);
  105. $buildType = build_type($buildName);
  106. $buildTime = build_date($buildName);
  107. $iniFile = "$buildBranch.$lang.ini";
  108. #####Set release servers
  109. @iniRequest = ( "ReleaseServers::$buildArch$buildType" );
  110. my( $iniRelServers ) = &GetIniSetting::GetSetting( @iniRequest );
  111. if( !$iniRelServers )
  112. {
  113. errmsg( "no [ReleaseServers] defined in [$iniFile], exit." );
  114. return 0;
  115. }
  116. @releaseServers = split( /\s+/, $iniRelServers );
  117. #####Set build machine
  118. if( $srcServer )
  119. {
  120. $iniBuildMachine = $srcServer;
  121. }
  122. else
  123. {
  124. @iniRequest = ( "BuildMachines::$buildArch$buildType");
  125. $iniBuildMachine = &GetIniSetting::GetSetting( @iniRequest );
  126. if( !$iniBuildMachine )
  127. {
  128. errmsg( "No [BuildMachines] defined in [$iniFile], exit." );
  129. return 0;
  130. }
  131. }
  132. @buildMachines = split( /\s+/, $iniBuildMachine );
  133. for my $bldMachine ( @buildMachines )
  134. {
  135. if( !&comlib::ExecuteSystem( "net view $bldMachine >nul 2>nul ") )
  136. {
  137. errmsg( "Failed to see [$bldMachine] via net view, exit. ");
  138. return 0;
  139. }
  140. }
  141. #####Set release Share Drive
  142. @iniRequest = ("ReleaseDrive::$computerName");
  143. $releaseDrive = &GetIniSetting::GetSettingEx( $buildBranch,$lang,@iniRequest );
  144. if ( !$releaseDrive )
  145. {
  146. $ENV{_ntdrive} =~ /(.*)\:/;
  147. $releaseDrive = $1;
  148. }
  149. #####Set <ReleaseShareName> & <ReleaseShareRootDir> & <RreleaseResDir>
  150. $buildMachineReleaseShareName = &comlib::GetReleaseShareName( $buildBranch, $lang );
  151. #####Set $releaseShareName hard code to release for srvrel specific
  152. $releaseShareName="release";
  153. $releaseShareRootDir = "$releaseDrive:\\$releaseShareName";
  154. $releaseResRootDir = "$releaseShareRootDir\\$lang";
  155. $releaseResDir = "$releaseShareRootDir\\$lang\\$buildName";
  156. #####Set latest share name
  157. $latestReleaseShareName = "$buildName.$lang";
  158. #####Set Push Dir
  159. if( lc($lang) eq "usa")
  160. {
  161. $tmpPostBldDir = $releaseResDir;
  162. $pushResDir = $releaseResDir;
  163. }
  164. else
  165. {
  166. $tmpPostBldDir = $releaseResDir."_TEMP";
  167. $pushResDir = $releaseResDir."_TEMP". "\\$lang";
  168. }
  169. if( -e $pushResDir && lc($lang) ne "usa")
  170. {
  171. errmsg( "Found [$pushResDir]\n, check if same process in progress, exit");
  172. return 0;
  173. }
  174. #####Set access user to the release share
  175. @iniRequest = ( "ReleaseAccess" );
  176. for my $access( @iniRequest )
  177. {
  178. my $iniAccess = &GetIniSetting::GetSetting( $access );
  179. @releaseAccess = split ( /\s+/, $iniAccess );
  180. last if( @releaseAccess );
  181. }
  182. @releaseAccess = ("$ENV{userDomain}\\$ENV{UserName}") if ( !@releaseAccess );
  183. #####Set free space required & number builds to keep for the local build machine
  184. @iniRequest = ("ReleaseServerFreeSpace\:\:$computerName");
  185. $freeSpaceReq = &GetIniSetting::GetSettingEx( $buildBranch,$lang, @iniRequest );
  186. $freeSpaceReq = 10 if ( !$freeSpaceReq);
  187. @iniRequest = ("ReleaseServerBuildsToKeep\:\:$computerName\:\:$buildArch$buildType");
  188. $numBuildToKeep = &GetIniSetting::GetSettingEx( $buildBranch,$lang, @iniRequest );
  189. $numBuildToKeep = 2 if( !$numBuildToKeep );
  190. #####Set conglomerators
  191. @iniRequest = ( "ConglomerationServers" );
  192. my( $iniAggServers ) = &GetIniSetting::GetSetting( @iniRequest );
  193. if( !$iniAggServers )
  194. {
  195. logmsg( "no [ConglomerationServers] defined in $iniFile." );
  196. $isConglomerator = 0;
  197. }
  198. else
  199. {
  200. @mConglomerators = split( /\s+/, $iniAggServers );
  201. $isConglomerator = 1;
  202. $isConglomerator = 0 if (!grep /^$computerName$/i, @mConglomerators);
  203. }
  204. #####Set Symbol Servers
  205. $symFarm = &GetIniSetting::GetSettingEx( $buildBranch,$lang,"SymFarm" );
  206. #####Set postbuildscripts path
  207. $postBldToolDir = "$ENV{RazzleToolPath}\\PostBuildScripts";
  208. #####Array as group in miscrel.txt
  209. @group = ( "lang", "build" );
  210. #####Share name and Share root dir for each group item
  211. %groupShareRootDir = ( "lang" => "$releaseShareRootDir\\$lang\\$buildNo.$buildBranch",
  212. "build" => "$releaseShareRootDir\\misc\\$buildNo.$buildBranch" );
  213. %groupShareName = ( "lang" => "$buildNo.$buildBranch.$lang",
  214. "build" => "$buildNo.$buildBranch.misc" );
  215. #####Define Valid Skus for the given languages and Architecture
  216. %validSkus = &cksku::GetSkus( $lang, $buildArch );
  217. @validSkus = keys %validSkus;
  218. logmsg( "TEMP Dir .................[$ENV{temp}]" );
  219. logmsg( "Log file ................[$ENV{LOGFILE}]" );
  220. logmsg( "Error file ..............[$ENV{ERRFILE}]" );
  221. logmsg( "Lauguage ................[$lang]" );
  222. logmsg( "Build name ...............[$buildName]" );
  223. logmsg( "Valid Skus ...............[@validSkus]" );
  224. logmsg( "ini file ................[$iniFile]" );
  225. logmsg( "Build Machine ............[$iniBuildMachine]" );
  226. logmsg( "Alternate Source server...[$srcServer]" );
  227. logmsg( "This computer ............[$computerName]" );
  228. logmsg( "Release Servers ..........[$iniRelServers]");
  229. logmsg( "Conglomerators ...........[$iniAggServers]" );
  230. logmsg( "Release Drive ............[$releaseDrive]" );
  231. logmsg( "Release share Resource ...[$releaseResDir]" );
  232. logmsg( "Latest release Share name [$latestReleaseShareName]" );
  233. ###logmsg( "Pull Path ................[$pullResDir]" );
  234. logmsg( "Push Path ................[$pushResDir]" );
  235. logmsg( "Release Access ...........[@releaseAccess]" );
  236. logmsg( "Free space required ......[$freeSpaceReq G]" );
  237. logmsg( "Number builds to keep ....[$numBuildToKeep]" );
  238. logmsg( "Is Conglomerator..........[$isConglomerator]" );
  239. if( $isConglomerator )
  240. {
  241. for my $key ( sort keys %groupShareName )
  242. {
  243. logmsg( "Conglomeration share name:Path [$groupShareName{$key}:$groupShareRootDir{$key}]" );
  244. }
  245. }
  246. logmsg( "Symbol Server.............[$symFarm]" );
  247. return 1;
  248. }
  249. #-----------------------------------------------------------------------------
  250. sub LoopPullServers
  251. {
  252. #####Set Pull Dir
  253. my $anyPullRes=0;
  254. for ( my $inx =0; $inx< @buildMachines; $inx++ )
  255. {
  256. if( $srcServer )
  257. {
  258. $pullResDir = "\\\\$buildMachines[$inx]\\$releaseShareName\\$lang\\$buildName";
  259. }
  260. else
  261. {
  262. if( lc($lang) eq "usa")
  263. {
  264. $pullResDir = "\\\\$buildMachines[$inx]\\$buildMachineReleaseShareName\\$buildName";
  265. }
  266. else
  267. {
  268. $pullResDir = "\\\\$buildMachines[$inx]\\$buildMachineReleaseShareName\\$lang\\$buildName";
  269. }
  270. }
  271. if( system ( "dir $pullResDir>nul 2>nul" ) )
  272. {
  273. wrnmsg( "[$pullResDir] not exists in [$buildMachines[$inx]]." );
  274. next;
  275. }
  276. $anyPullRes = 1;
  277. logmsg( "Pull Path ................[$pullResDir]" );
  278. return 0 if( !$powerLess && !&RemoteRelease );
  279. }
  280. if( !$anyPullRes )
  281. {
  282. errmsg( "[$buildName] not found in [@buildMachines] for [$lang]" );
  283. return 0;
  284. }
  285. return 1;
  286. }
  287. #-----------------------------------------------------------------------------
  288. sub RemoteRelease
  289. {
  290. my ( $cmdLine, $evtList, @copyList );
  291. #####Examine if <ReleaseResDir> exists already.
  292. if( (-e $releaseResDir ) && lc($lang) ne "usa" )
  293. {
  294. &comlib::ExecuteSystem( "md $tmpPostBldDir" ) if( !(-e $tmpPostBldDir) );
  295. return 0 if( !&comlib::ExecuteSystem( "move $releaseResDir $pushResDir" ) );
  296. }
  297. if( !( -e $pushResDir ) ){ &comlib::ExecuteSystem( "md $pushResDir" ); }
  298. if( !( -e "$pushResDir\\build_logs" ) ){
  299. &comlib::ExecuteSystem( "md $pushResDir\\build_logs" );
  300. }
  301. if( !( open FILE, "> $pushResDir\\build_logs\\SrvRelFailed.txt" ) ) {
  302. errmsg("Could not open srvrelstatus file for writing: $!");
  303. return 0;
  304. }
  305. print FILE "NOT RAISEABLE\n";
  306. close FILE;
  307. #####Collect all the dirs to be copied
  308. my @excludeDir = keys %validSkus;
  309. push( @excludeDir, "build_logs" );
  310. push( @excludeDir, "symbols.pri" ) if( $symFarm );
  311. my $tmpFile = "$ENV{TEMP}\\tmpFile";
  312. &comlib::ExecuteSystem( "dir /b /ad $pullResDir > $tmpFile" );
  313. @copyList = &comlib::ReadFile( $tmpFile );
  314. unlink( $tmpFile );
  315. for ( my $i = 0; $i < @copyList; $i++)
  316. {
  317. for my $theExclude ( @excludeDir )
  318. {
  319. if( lc($copyList[$i]) eq lc($theExclude) )
  320. {
  321. splice( @copyList, $i, 1);
  322. $i--;
  323. last;
  324. }
  325. }
  326. }
  327. push( @copyList, "." );
  328. push( @copyList, "build_logs" );
  329. #####Kick off copyscripts with maximum 4 threads
  330. my @cmdAry=();
  331. $evtList = "";
  332. for( my $inx=0; $inx < @copyList; $inx++)
  333. {
  334. $cmdLine = "start /min cmd /c copyscript.cmd $lang $buildName $copyList[$inx] $pullResDir $pushResDir $ENV{logfile}";
  335. push( @cmdAry, $cmdLine );
  336. $evtList .= "$lang.$buildName.$copyList[$inx] ";
  337. if( !(( $inx + 1 ) % 4) || ($inx+1) == @copyList )
  338. {
  339. logmsg( "\n");
  340. for $cmdLine( @cmdAry ){ system( $cmdLine ); }
  341. &comlib::ExecuteSystem( "perl $postBldToolDir\\cmdevt.pl -wv $evtList" );
  342. @cmdAry=();
  343. $evtList="";
  344. }
  345. }
  346. #####Copy conglomerators again to different pathes if this is conglomerator
  347. if( $isConglomerator ){ return 0 if ( !&MiscCopy ); }
  348. #####Call cdimage & filechk
  349. return 0 if (!&PostCopy);
  350. #####Check error logs
  351. if( -e $ENV{errfile} && !(-z $ENV{errfile}) )
  352. {
  353. logmsg("Please check error at $ENV{errfile}");
  354. return 0;
  355. }
  356. if( -e "$releaseResDir\\build_logs\\SrvRelFailed.txt" ) {
  357. unlink "$releaseResDir\\build_logs\\SrvRelFailed.txt";
  358. }
  359. logmsg("srvrel Copy Successfully");
  360. return 1;
  361. }
  362. #-----------------------------------------------------------------------------
  363. sub MiscCopy
  364. {
  365. my ( $cmdLine, $copyFlag );
  366. for my $theGroup ( @group )
  367. {
  368. &comlib::ExecuteSystem("md $groupShareRootDir{$theGroup}" )if( !( -e $groupShareRootDir{$theGroup}) );
  369. if( system( "net share $groupShareName{$theGroup} >nul 2>nul" ) )
  370. {
  371. $cmdLine = "rmtshare \\\\$ENV{computerName}\\$groupShareName{$theGroup}=$groupShareRootDir{$theGroup}";
  372. $cmdLine .= " /grant $ENV{USERDOMAIN}\\$ENV{USERNAME}:read";
  373. #####Raiseall.pl should grant access to these shares in the main build lab
  374. if ( !$ENV{MAIN_BUILD_LAB_MACHINE} )
  375. {
  376. for my $ID ( @releaseAccess )
  377. {
  378. $cmdLine .= " /grant $ID:read";
  379. }
  380. }
  381. }
  382. &comlib::ExecuteSystem( $cmdLine );
  383. my @hashTable = &comlib::ParseTable( $theGroup, $lang, $buildArch, $buildType );
  384. for my $line( @hashTable )
  385. {
  386. my $from = "$pushResDir\\$line->{SourceDir}";
  387. my $to = "$groupShareRootDir{$theGroup}\\$line->{DestDir}";
  388. if( uc($line->{DestDir}) eq "IFS" || uc($line->{DestDir}) eq "HAL" )
  389. {
  390. $copyFlag = "/yei";
  391. }
  392. else
  393. {
  394. $copyFlag = "/ydei";
  395. }
  396. my $tmpfile = &comlib::CreateExcludeFile( $line->{ExcludeDir} );
  397. &comlib::ExecuteSystem( "xcopy $copyFlag /EXCLUDE:$tmpfile $from $to" );
  398. if ( $line->{DestDir} =~ /IA64/i)
  399. {
  400. &comlib::ExecuteSystem( "echo BUGBUG#336842" );
  401. &comlib::ExecuteSystem( "echo foo > $to\\efinvr.exe");
  402. }
  403. }
  404. }
  405. return 1;
  406. }
  407. #-----------------------------------------------------------------------------
  408. sub PostCopy
  409. {
  410. if( @validSkus )
  411. {
  412. #####Call cdimage
  413. local $ENV{_ntpostbld}=$tmpPostBldDir;
  414. local $ENV{_ntpostbld_bak}=$ENV{_ntpostbld};
  415. local $ENV{_BuildArch}=$buildArch;
  416. local $ENV{_BuildType}=$buildType;
  417. if( lc($buildArch) eq "x86" )
  418. {
  419. $ENV{x86}=1;
  420. $ENV{386}=1;
  421. $ENV{ia64}="";
  422. $ENV{amd64}="";
  423. }
  424. elsif ( lc($buildArch) eq "amd64" )
  425. {
  426. $ENV{x86}="";
  427. $ENV{386}="";
  428. $ENV{ia64}="";
  429. $ENV{amd64}=1;
  430. }
  431. elsif ( lc($buildArch) eq "ia64" )
  432. {
  433. $ENV{x86}="";
  434. $ENV{386}="";
  435. $ENV{ia64}=1;
  436. $ENV{amd64}="";
  437. }
  438. logmsg( "set %_ntpostbld% = [$ENV{_ntpostbld}]");
  439. logmsg( "set %_ntpostbld_bak% = [$ENV{_ntpostbld_bak}]");
  440. logmsg( "Set x86 = [$ENV{x86}]" );
  441. logmsg( "Set 386 = [$ENV{386}]" );
  442. logmsg( "Set ia64 = [$ENV{ia64}]" );
  443. logmsg( "Set amd64 = [$ENV{amd64}]" );
  444. return 0 if (!&comlib::ExecuteSystem( "$postBldToolDir\\cdimage.cmd -l:$lang -d:release" ) );
  445. #####Call filechk
  446. return 0 if( !&comlib::ExecuteSystem( "perl $postBldToolDir\\filechk.pl -l:$lang") );
  447. }
  448. else
  449. {
  450. logmsg( "Skip cdimage.cmd and filechk.pl for MUI release" );
  451. }
  452. #####Special handle for International
  453. if( lc($lang) ne "usa" )
  454. {
  455. #####Move $pushResDir to $releaseResDir
  456. return 0 if( !&comlib::ExecuteSystem( "move $pushResDir $releaseResDir") );
  457. #####Delete empty $tmpPostBldDir
  458. return 0 if( !&comlib::ExecuteSystem( "rd /s /q $tmpPostBldDir" ) );
  459. }
  460. return 1;
  461. }
  462. #-----------------------------------------------------------------------------
  463. sub DeletePublicShare
  464. {
  465. #####use system for not logging the error message if the share is does not exist.
  466. if( !system( "net share $latestReleaseShareName >nul 2>nul") )
  467. {
  468. return 0 if( !&comlib::ExecuteSystem( "net share $latestReleaseShareName /d /y" ) );
  469. }
  470. return 1;
  471. }
  472. #-----------------------------------------------------------------------------
  473. sub CreatePublicShare
  474. {
  475. my ( $cmdLine );
  476. if( system( "net share $latestReleaseShareName >nul 2>nul") )
  477. {
  478. $cmdLine = "rmtshare \\\\$ENV{computerName}\\$latestReleaseShareName=$releaseResDir";
  479. $cmdLine .= " /grant $ENV{USERDOMAIN}\\$ENV{USERNAME}:read";
  480. #####Raiseall.pl should grant access to these shares in the main build lab
  481. if ( !$ENV{MAIN_BUILD_LAB_MACHINE} )
  482. {
  483. for my $ID ( @releaseAccess )
  484. {
  485. $cmdLine .= " /grant $ID:read";
  486. }
  487. }
  488. return 0 if( !&comlib::ExecuteSystem( $cmdLine ) );
  489. }
  490. return 1;
  491. }
  492. #-----------------------------------------------------------------------------
  493. sub VerifyDiskSpace
  494. {
  495. my ($availDiskSpace, $retry, $reqSpace ) = (0, 0, 1000000000);
  496. my $tmpFile = "$ENV{_ntdrive}\\freeSize";
  497. my @freeSize;
  498. $reqSpace *= $freeSpaceReq;
  499. while( $retry < 2)
  500. {
  501. system( "cd /d $releaseDrive:\&freedisk>$tmpFile&cd /d $ENV{_ntdrive}" );
  502. @freeSize = &comlib::ReadFile( $tmpFile );
  503. unlink( $tmpFile );
  504. if( ($freeSize[0] - $reqSpace) > 0 )
  505. {
  506. logmsg( "Available disk space [$freeSize[0]], delete builds is not required." );
  507. return 1;
  508. }
  509. my ( $cmdLine ) = "$postBldToolDir\\deletebuild.cmd AUTO \/l $lang \/a $buildArch$buildType \/f $freeSpaceReq \/k $numBuildToKeep";
  510. return 1 if( &comlib::ExecuteSystem( $cmdLine ) );
  511. ++$retry;
  512. }
  513. return 0;
  514. }
  515. #-----------------------------------------------------------------------------
  516. sub PurgeOldCdimage
  517. {
  518. for my $theDir ( @validSkus )
  519. {
  520. my $curDir = "$releaseResDir\\$theDir";
  521. if( -e $curDir )
  522. {
  523. logmsg( "Purging old cdimage [$curDir]" );
  524. &comlib::ExecuteSystem( "rd /s /q $curDir" );
  525. }
  526. }
  527. return 1;
  528. }
  529. #-----------------------------------------------------------------------------
  530. 1;